Skip to content

3 Getting started

Dan Geabunea edited this page Apr 1, 2015 · 1 revision

Using EasyCsv is well...easy. Let's read a document and print to the console the value of the first column in each row.

Content of document.csv

Name,Age
John,23
Anna,45

Code

String pathToCsvDocument = "\home\user\document.csv";
CsvDocument document = CsvDocument.read(pathToCsvDocument);

for(CsvRow row : document .getCsvRows()){
    System.out.print(row.getColumnAtIndex(0).getColumnValue());
}

Output

John
Ana

Clone this wiki locally