Removing a row from an Excel sheet with Apache POI HSSF

前端 未结 7 1102
小鲜肉
小鲜肉 2020-11-29 05:38

I\'m using the Apache POi HSSF library to import info into my application. The problem is that the files have some extra/empty rows that need to be removed first before pars

7条回答
  •  悲哀的现实
    2020-11-29 06:16

    The HSSFRow has a method called setRowNum(int rowIndex).

    When you have to "delete" a row, you put that index in a List. Then, when you get to the next row non-empty, you take an index from that list and set it calling setRowNum(), and remove the index from that list. (Or you can use a queue)

提交回复
热议问题