holgerbrandl / krangl

krangl is a {K}otlin DSL for data w{rangl}ing
MIT License
561 stars 50 forks source link

CSV files without header take first line as a header always #17

Closed melastmohican closed 7 years ago

melastmohican commented 7 years ago

Apache Commons CSV allows specifying headers. Iterable<CSVRecord> records = CSVFormat.RFC4180.withHeader("ID", "CustomerNo", "Name").parse(in); for (CSVRecord record : records) { String id = record.get("ID"); String customerNo = record.get("CustomerNo"); String name = record.get("Name"); }

holgerbrandl commented 7 years ago

I think you've solved it yourself.