title: How can i get total number of rows excluding from BLANK SPACES(blank rows) from excel using apachi POI java?
body: <p>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.</p>
  
  <p>my code was </p>
  
  <pre><code>     Sheet sheet = workbook.getSheetAt(0);
       int maxNumOfCells = sheet.getRow(0).getLastCellNum();
       // The the maximum number of columns
       int totalRows = sheet.getLastRowNum(); 
       // or  sheet.getPhysicalNumberOfRows();  
  </code></pre>
  
  <p>both are returning me total rows in the sheet than returning rows that have data alone.</p>
  
  <p>It should return totalRows excluding blank rows.?</p>