FasterXML / FasterXML/jackson-dataformats-text

CSV Schema map headers to Pojo

Open
#26 0 comments 1 reaction 0 assignees View on GitHub
csv
Dominant language
Java
Stars
455
Forks
164
Avg merge
6d 10h
Merged PRs (30d)
2

Description

Hi,

There is a use case where we know the CSV column names but not the order.
It would be great if there was a way to map headers in the CSV to POJO properties.

Something like:
```
Map csvHeaders = new HashMap();
csvHeaders.put("headerX", "propertyX");
csvHeaders.put("headerY", "propertyY");
CsvSchema bootstrapSchema = CsvSchema.emptySchema().withHeaderMap(csvHeaders);
...
```

Possibly with an option to either ignore extra columns or throw an error if there are missing columns.

Does anyone know if this is possible/likely?

Thanks for a great library.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.