Wednesday, January 20, 2010

Open source CSV reader

A useful library can be used to read a CSV file or simply parse a CSV string.  A huge time saver.

http://opencsv.sourceforge.net/project-summary.html
Maven Dependency
GroupId: net.sf.opencsv
ArtifactId: opencsv
Version: 2.1
Type: jar

Code sample, input could be

CSVParser parser = new CSVParser();
String values[] = parser.parseLine(lineText);                    

Sample input
This, "is", a. "huge time save utility. Handles this comma , nicely "

No comments: