RSS

>CSV reading from Java

19 Jul

>If you need to process CSV files, for example as a result of an export from Excel or OpenOffice.org Calc, then try CsvReader, an LGPL Java-library. It works remarkably simple:

CsvReader reader = new CsvReader("input.csv");

// Read all headers (the first line)
reader.readHeaders();

// Read all remaining lines
while (reader.readRecord()) {
String productID = reader.get("ProductID");
// etc.
}

reader.close();

I’m using CsvReader 2.0, released in December 2006.

Advertisements
 
Leave a comment

Posted by on 19 July 2007 in calc, csv, csvreader, excel, export, import, java, oo, openoffice.org

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: