How to get an Excel Blank Cell Value in Apache POI?

后端 未结 9 1524
孤独总比滥情好
孤独总比滥情好 2020-12-01 05:02

I have a huge excel file with tons of columns which looks like this :-

Column1 Column2 Column3 Column4 Column5
abc             def             ghi
        mn         


        
9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 06:03

    If you want to get all cells, no matter if they exist or not, then the iterator isn't for you. Instead, you need to manually fetch the appropriate cells, likely with a missing cell policy

    for(Row row : sheet) {
       for(int cn=0; cn " + cell.toString());
       }
    }
    

    There's more details on all of this in the Apache POI documentation on iterating over cells

提交回复
热议问题