title: Java String Parsing Error
body: <p>Hey can someone help me with my error i am getting. I am taking apart lines out of my file and check wether they are low med or high. If the string is blank i want to read the next line in the file.  I think the error is when i am parsing the sting to a double. Heres my code any help is appriciated!
    First here is my error </p>
  
  <pre><code>Exception in thread "main" java.lang.NumberFormatException: empty String
      at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
      at java.lang.Double.parseDouble(Unknown Source)
      at BSCQueryManager.displayBar(BSCQueryManager.java:431)
      at BSCQueryManager.main(BSCQueryManager.java:57)
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>String vMag;
              String data;
              double v;
              int highCount = 0;
              int medCount = 0;
              int lowCount = 0;
              // read file
              File inFile = new File("bsc.dat");   
              Scanner starFile = new Scanner(inFile);
              // while there is a vmag
              while(starFile.hasNext()){
                  // read next line
                  data = starFile.nextLine();
                  data = data.substring(102, 107);
                  data.trim();
              // if no vmag read next line
                  if(data.trim()!= ""){
                      v = Double.parseDouble(data);
                      // if vmag is &gt; 6.0 add to countHigh
                      if (v &gt; 6){
                          highCount++;
                      }
                      // if vmag is 5-6 add to countMed
                      if (v &gt;= 5 &amp;&amp; v &lt;= 6){
                          medCount++;
                      }
                      // if vmag is &lt; 5 add to countLow
                      if (v &lt; 5){
                          lowCount++;
                      }
                  // end if
                  }
              // end while
              }
  
              // display label
              System.out.println(label);
              System.out.println(highCount);
              System.out.println(lowCount);
              System.out.println(medCount);
  </code></pre>