Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Read a CSV file

Java: Read a CSV file
{filelink=7560}

import java.io.BufferedReader;
import java.io.FileReader;
public class CSVFile
 {
  public static void main(String[] args) throws Exception
  	 {
    BufferedReader br = new BufferedReader(new FileReader("test.csv"));
    String ligne = null;
    while ((ligne = br.readLine()) != null)
     {
      // Return rows in a String array
      String[] data = ligne.split(",");
      // print the contents of array
      for (String val : data)
      {
        System.out.println(val);
      }
    }
    br.close();
  }
}

Users who found this page were searching for:

  • Java read CSV files
  • Java Read From CSV
  • python select rows
  • python read binary file

No comments yet.

Leave a Comment