title: Reading text file and skipping blank lines until EOF is reached
body: <p>I am trying to read csv file full of text; however if there is a blank line in the middle somewhere, the whole thing breaks and I get a:  </p>
  
  <pre><code>java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException
  </code></pre>
  
  <p>How would I go about removing/ignoring blank lines as long as it's not the end of the file?</p>
  
  <pre><code>        file = new FileReader(fileName);
          @SuppressWarnings("resource")
          BufferedReader reader = new BufferedReader(file);
          while ((line = reader.readLine()) != null) {
                       //do lots of stuff to sort the data into lists etc
          }
      } catch (Exception e) {
          System.out.println("INPUT DATA WAS NOT FOUND, PLEASE PLACE FILE HERE: " + System.getProperty("user.dir"));
          throw new RuntimeException(e);
      } finally {
          if (file != null) {
              try {
                  file.close();
              } catch (IOException e) {
                  // Ignore issues during closing
              }
          }
      }
  </code></pre>