Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Schema map headers to Pojo #26

Open
bratzelk opened this issue Jul 7, 2017 · 0 comments
Open

CSV Schema map headers to Pojo #26

bratzelk opened this issue Jul 7, 2017 · 0 comments
Labels

Comments

@bratzelk
Copy link

bratzelk commented Jul 7, 2017

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<String, String> csvHeaders = new HashMap<String, String>();
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.

@bratzelk bratzelk changed the title CSV Schema map headers to Pojo (csv) CSV Schema map headers to Pojo Jul 7, 2017
@cowtowncoder cowtowncoder changed the title (csv) CSV Schema map headers to Pojo CSV Schema map headers to Pojo Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants