title: Validating a particular column in CSV
body: <p>I am validating a particular column in a CSV file , I have basically two approaches i.e</p>
  
  <ul>
  <li><p>Approach 1 
  I can Read the CSV file line by line with a <code>BufferedReader</code> and Stop when 
  I  hit a line that startsWith the thing I'm looking for </p>
  
  <pre><code>try {   
       BufferedReader br = new BufferedReader(
           new InputStreamReader(item.getInputStream()));
  String strLine = "";
  StringTokenizer st = null;
  String value = "";
  while ((strLine = br.readLine()) != null) {
      st = new StringTokenizer(strLine, ",");
      while (st.hasMoreTokens()) {
          value = st.nextToken();
          if ((value != null) &amp;&amp; (("MyString1".equals(value)
              || ("MyString2".equals(value)
              || ("MyString3".equals(value)))  {
              // Send error Message   
          }
      }
  }
  </code></pre></li>
  <li><p>Second Approach is use a String.split as below </p>
  
  <pre><code>Scanner s = new Scanner(item.getInputStream());  
  while(s.hasNextLine()) {  
      String[] fields = s.nextLine().split("\\s*,\\s*", -1);  
      for(int i = 0;i &lt; fields.length;i++) {  
          if(!"".equals(fields[i]) &amp;&amp; ...  
      }  
  }  
  s.close();
  </code></pre></li>
  </ul>
  
  <p>Please suggest a better approach </p>