Apache Poi excel删除空行 [英] Apache Poi excel remove blank rows
问题描述
我尝试了代码从这里,但它不起作用。
我发现任何解决方案如何轻松获得真正的行数,但我已经找到一个解决方案来删除这样的行,这可能对处理类似问题的人有用。见下文。
我搜索了一下,发现这个解决方案
它所做的是从底部删除可能完全符合您想要的空行。
I have an excel file with 3000 rows. I remove the 2000 (with ms excel app), but when i call the sheet.getLastRowNum() from code , it gives me 3000 (instead of 1000).. How can i remove the blank rows?
I tried the code from here but it doesn't works....
I haven't found any solution on how to easily get the "real" number of rows but I've found a solution to remove such rows which might be useful to someone who's tackling similar issue. See bellow.
I've searched a bit and found this solution
All it does is it deletes those empty rows from the bottom which might be exactly what you want.
这篇关于Apache Poi excel删除空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!