title: Scanner missing first line of .txt file
body: <p>I think I'm doing something really silly, but I'm new to Java so bear with me. I'm using a FileReader and Scanner to read through the lines of a .txt file. After grabbing each line, I extract some information out and then move the line. This is what my simplified method looks like:</p>
  
  <pre><code>Reader fileReader = new FileReader("test.txt");
  Scanner scanner = new Scanner(fileReader);
  
  public static textList(Scanner scanner){
     while (scanner.hasNextLine()){
        scanner.nextLine();
        while(scanner.hasNext()){
           // Extract information from each line and do some stuff with it
           // using scanner.next();
        }
     }
  }
  // scanner is closed in the same method that creates it and the FileReader.
  </code></pre>
  
  <p>My problem is, if I leave the <code>scanner.nextLine()</code> where it is, I'll always skip the first line of the .txt file, but if I move it to the end of the <code>while( scanner.hasNextLine())</code>, I get a "no such line exists" exception when the scanner reaches the end of the .txt file.</p>
  
  <p>Any help and guidance would be gratefully received!</p>
  
  <p>Thanks</p>