RSS

Category Archives: csvreader

>CSV reading from Java

>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.

 
Leave a comment

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