0

I have been using Apache POI API to work on an Excel file. The requirement is to remove certain row(s) from the given Excel file.

In Apache POI API, I am using Sheet.removeRow(rowIndex) method to remove the row from the sheet. Then I use sheet.shiftRows() method to shift the next row up to fill the empty row. But, this takes a long time when it comes to handling a large Excel file with approximately 200k rows.

Sheet.removeRow(rowIndex) method only clears the content in the row and not deleting the entire row permanently.

Is there an API which removes the row permanently (not just clear the row content), so that it would take less time to process the whole file?

James Z
  • 12,209
  • 10
  • 24
  • 44
IMJS
  • 863
  • 2
  • 13
  • 25
  • http://stackoverflow.com/questions/1834971/removing-a-row-from-an-excel-sheet-with-apache-poi-hssf – K139 May 07 '15 at 20:22
  • Fully deleting rows is always going to be slow, as you have to renumber all the existing rows, formattings, formulas, merged regions etc – Gagravarr May 08 '15 at 06:36

0 Answers0