title: How to find the total line number in xls file, but the file has some empty lines in between proper rows?
body: <p>I have a test case to get the total lines present in the xls file using selenium, But i had a empty lines in between some lines how to get the total lines which is not empty?</p>
  
  <p>Please refer below mentioned image for more details: <br></p>
  
  <p><a href="https://i.stack.imgur.com/gKczh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gKczh.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me on this issue?<br>
  Your help is much appreciated.<br>
  Best Regards.</p>
  
  <pre><code>public int getRecordsCountInBudgetingReport(String FileName) {
          String downloadPath = "path";
          int lineNumberCount = 0;
          try {
              if (!FileName.isEmpty() || FileName != null) {
                  String filePath =   downloadPath + System.getProperty("file.separator") + FileName;
                  System.out.println(filePath);
                  File file = new File(filePath);
  
                  if (file.exists()) {
                      System.out.println("File found :" +FileName);
                      FileReader fr = new FileReader(file);
  
                      LineNumberReader linenumberreader = new LineNumberReader(fr);
                      //linenumberreader.
                      while (linenumberreader.readLine() != null) {
                          lineNumberCount++;
                      }
                      //To remove the header
                      lineNumberCount=lineNumberCount-3;
                  linenumberreader.close();
                  } else {
                      System.out.println("File does not exists");
                  }
              }
          }
          catch (IOException e) {
              e.printStackTrace();
          }
  
          return lineNumberCount;
      }
  </code></pre>