title: How to read data from a specific column from csv file using jsp/java?
body: <p>In my application I need to read a specific column of tab separated csv file using jsp. But I can read the data of full row not a specific column. </p>
  
  <p>I need help this regard. Please help me</p>
  
  <p>Thanks   </p>
  
  <p>mycode:</p>
  
  <pre><code>    &lt;%@ page import="java.io.*"%&gt;
      &lt;html&gt;
      &lt;body&gt;
      &lt;% 
      String fName = "c:\\csv\\myfile.csv";
      String thisLine; 
      int count=0; 
      FileInputStream fis = new FileInputStream(fName);
      DataInputStream myInput = new DataInputStream(fis);
      int i=0; 
      %&gt;
      &lt;table&gt;
      &lt;%
      while ((thisLine = myInput.readLine()) != null)
     {
      String strar[] = thisLine.split(",");
      for(int j=0;j&lt;strar.length;j++)
      {
      if(i!=0)
      {
       out.print(" " +strar[j]+ " ");
      }
      else
      {
      out.print(" &lt;b&gt;" +strar[j]+ "&lt;/b&gt; ");
      }
      }
      out.println("&lt;br&gt;");
      i++;
      } 
      %&gt;
      &lt;/table&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>