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
There was an error while loading. Please reload this page.