I've to iterate rows and add it to a list, but I'm getting total numbers of rows as total rows present in excel sheet i.e.,1001 rows but I have only 3 rows including headers, i have to stop the loop with the size of the row number.
my code was
Sheet sheet = workbook.getSheetAt(0);
int maxNumOfCells = sheet.getRow(0).getLastCellNum();
// The the maximum number of columns
int totalRows = sheet.getLastRowNum();
// or sheet.getPhysicalNumberOfRows();
both are returning me total rows in the sheet than returning rows that have data alone.
It should return totalRows excluding blank rows.?