apache poi - java read part of large xlsx file -


what fastest , less memory intensive way read portion of large xlsx file?

currently have code:

fileinputstream fis = null; fis = new fileinputstream("d:/verylargefile.xlsx");  xssfworkbook workbook = new xssfworkbook(fis); xssfsheet sheet = workbook.getsheetat(0);  int r = sheet.getphysicalnumberofrows();     int c = sheet.getrow(1).getlastcellnum();   (int row = 1; rows < r;row++){    (int cell = 1; cell < c;cell++){        int cellvalue = (int)sheet.getrow(row).getcell(cell).getnumericcellvalue()        //do simple math op cell or several cells     } } 

so need large number of simple math operations (for example average of every 5 cells in every row or simillar) , fast, small part of large xlsx file @ once. code above, getting heap space error 10mb xlsx file , 1gb ram dedicated java vm (-xms1000m).

thank you


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -