marcosbeirigo marcosbeirigo - 3 months ago 16
Java Question

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

Answer

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