I want to append data on an existing excel file, my code is as follows:
XSSFWorkbook book = new XSSFWorkbook("/my.xlsx");
Sheet sheet = book.getSheetAt(1);
//do something
But this file already has a lot of data, so I get out of memory error.
I know it is possible to use SXSSFWorkbook
, but this doesn't work for me, because it still loads the existing data into memory:
new SXSSFWorkbook(new XSSFWorkbook("/my.xlsx"));
How can I solve this problem with limited memory? thanks in advance.
As mentioned above, I hope that I can write data in specified rows and columns to an excel file that already has a large amount of data in limited memory.