No header mapping was specified, the record values can’t be accessed by name (Apache Commons CSV)

Calling withHeader() to the default Excel CSV format worked for me:

CSVFormat.EXCEL.withHeader().parse(in);

The sample in the documentation is not very clear, but you can found it here
:
Referencing columns safely:
If your source contains a header record, you can simplify your code and safely reference columns, by using withHeader(String…) with no arguments:
CSVFormat.EXCEL.withHeader();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)