Search code examples
javaapache-poixssf

How to get the last column index reading excel file?


How do i get the index of the last column when reading a xlsx file using the Apache POI API?

There's a getLastRowNum method, but I can't find nothing related to the number of columns...


EDIT: I'm dealing with XLSX files


Solution

  • I think you'll have to iterate through the rows and check HSSFRow.getLastCellNum() on each of them.