title: How to skip an Empty line while reading a file (java)?
body: <p>I am trying to read this file, and then put it into a List:</p>
  
  <pre><code>23333
  Manuel Oliveira
  19
  
  222222
  Mário Santos
  18
  </code></pre>
  
  <p>using Scanner. 
  This is how I've done if Ignore the empty line between 19 and 222222.</p>
  
  <pre><code>public List&lt;Aluno&gt; lerFicheiro ( String nomeF) throws FileNotFoundException{
      List&lt;Aluno&gt; pauta = new LinkedList&lt;Aluno&gt;();
  try{
      Scanner s = new Scanner ( new File ( nomeF));
      int cont = 0;
      String numero = null;
      String nome = null;;
      String nota;
      while ( s.hasNextLine())
      {
          if ( cont ==0)
          {
               numero = s.nextLine();
          }
          else
          {  
            if ( cont == 1) 
               nome = s.nextLine();
            else
            {   
                if ( cont == 2) 
                {
                    nota = s.nextLine();
                    cont =-1;
                    pauta.add( new Aluno(Integer.valueOf(numero), nome, nota)); 
                }
             }
          }
          cont++;
      }
      s.close();
  }
  catch ( FileNotFoundException e)
  {
      System.out.println(e.getMessage());
  }
  return pauta;
  }
  </code></pre>
  
  <p>But I've no idea how to still read it with the empty line.
  Thank you.</p>