I have a large spread sheet. It has 10 sheets, each with 1m rows. With Java, I need to run an algorithm for each row, return a value for each row and insert back into the excel file.
My idea was to load the file into ram, do calculations for each row, store the result in a list, and insert back to excel in order, but I didn't anticipate the issues dealing with the data size.
I tried XSSF, and it wasn't able to load such a large file. After waiting for a few hours it gave me the OOM error.
I tried increasing heap in run->run configurations->arguments, and in control panel->java. It didn't work.
I tried using the following StreamingReader and it didn't work.
FileInputStream in = new FileInputStream("D:\\work\\calculatepi\\sampleresult.xlsx");
Workbook workbook = StreamingReader.builder()
.rowCacheSize(100)
.bufferSize(4096)
.open(in);
I'm really out of clue and not sure what to do. Is there no easy way to do this?