title: java- How do I count the empty spaces between paragraphs and subtract them from the total line count?
body: <p>If I read a file the have empty spaces between paragraphs, how do I count the empty spaces and subtract them from the total line count?    </p>
  
  <pre><code>public int countLinesInFile(File f){
      int lines = 0;
      try {
          BufferedReader reader = new BufferedReader(new FileReader(f));
  
          while (reader.readLine() != null){
              lines++;    
          }
          reader.close();
      } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      return lines;
  }
  </code></pre>