Java: Open CSV Parser

April 12th, 2010 by jeremychone

Parsing CSV is not as simple at it seems. Not hard, but cumbersome.

Here is a simple Lib that does the job: Open CSV (download)

CSVReader reader = new CSVReader(new FileReader(ADDRESS_FILE));
String [] nextLine;
while ((nextLine = reader.readNext()) != null) {
	System.out.println("Name: [" + nextLine[0] + "]\nAddress: [" + nextLine[1] + "]\nEmail: [" + nextLine[2] + "]");
}

One Response to “Java: Open CSV Parser”

  1. Sachin Doiphode Says:

    I have ‘\’ in string and CSVReader is not able to recognize it.
    How to read ‘\’ character which is generally in path.

Leave a Reply