title: Counting lines from a csv file
body: <p>I am trying to count the amount of r,t, and c's in the below csv file.  </p>
  
  <p>I am currently returning the values 4 c's 0 r's and 3 t's, which is not an accurate result. Can someone help me identify the error in my code?  </p>
  
  <pre><code>public static int getCount ( String fileName, String letter )
  {
  int count = 0;
  String line;
  String[] lineArray new String[3];  
  Scanner sc = new Scanner (System.in);  
  try  
  {  
      BufferedReader br = new BufferedReader(new FileReader(fileName));  
      count = 0;  
      while (br.readLine() != null)  
      {  
          line = br.readLine();  
          lineArray = line.split(",");  
          for (int i = 0; i &lt; lineArray.length; i++)  
          {  
  (lineArray[0].equals(letter))count++;  
          }  
      }  
      br.close();  
  }  
  return count;  
  }
  </code></pre>
  
  <p>I am reading off a csv file.  </p>
  
  <pre><code>r,21.2,12.2  
  c,50  
  t,23.4,56.8  
  t,15.3,12.2  
  c,32  
  t,32.3,23.5  
  </code></pre>