title: Reading CSV file line by line and parsing it
body: <p>I have a CSV file that I need to read line by line with the help of a <code>Scanner</code> and store only country names into an array of strings. Here is my CSV file:</p>
  
  <pre><code>World Development Indicators
  Number of countries,4
  Country Name,2005,2006,2007
  Bangladesh,6.28776238,13.20573922,23.46762823
  "Bahamas,The",69.21279415,75.37855087,109.340767
  Brazil,46.31418452,53.11025849,63.67475185
  Germany,94.55486999,102.2828888,115.1403608
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>public String[] getCountryNames() throws IOException, FileNotFoundException{
      String[] countryNames = new String[3];
      int index = 0;
      BufferedReader br = new BufferedReader(new FileReader(fileName));
      br.readLine();
      br.readLine();
      br.readLine();
      String line = br.readLine();
      while((br.readLine() != null) &amp;&amp; !line.isEmpty()){
          String[] countries = line.split(",");
          countryNames[index] = countries[0];
          index++;
          line = br.readLine();
      }
      System.out.println(Arrays.toString(countryNames));
      return countryNames;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[Bangladesh, Brazil, null]
  </code></pre>
  
  <p>For some reason it skips "Bahamas, The" and can't read Germany. Please help me, I have been stuck on this method for hours already. Thanks for your time and effort. The return should be an array of Strings (country names).</p>