Read excel file 2010 apache poi ignoring empty cells

前端 未结 1 1797
谎友^
谎友^ 2021-01-15 11:38

I am having an problem, while java application reading Excel file .xlsx extention, The application is working normally, but in the workbook has many sheets, 1, 2 sheets read

相关标签:
1条回答
  • 2021-01-15 12:07

    The iterators only iterate over cells that are defined in the file. If the cell has never been used in Excel, it probably won't appear in the file (Excel isn't always consistent...), so POI won't see it

    If you want to make sure you hit every cell, you should lookup by index instead, and either check for null cells (indicating the cell has never existed in the file), or set a MissingCellPolicy to control how you want null and blank cells to be treated

    0 讨论(0)
提交回复
热议问题