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

How to read multiple columns with same name #22

Open
chiragrlti opened this issue Dec 11, 2019 · 3 comments
Open

How to read multiple columns with same name #22

chiragrlti opened this issue Dec 11, 2019 · 3 comments

Comments

@chiragrlti
Copy link

I have 2 columns in my excel with column name "Addr line1" (one for source and one for dest address). how should i read them?

@millij
Copy link
Owner

millij commented Dec 12, 2019

@chiragrlti
At this moment, the Reader implementations expects one-to-one mapping between columns and Java Class properties.
Having 2 columns with the same name doesn't satisfy the current expectation.

One workaround is, change the column name and read it.

@millij
Copy link
Owner

millij commented Dec 12, 2019

Potential Solution is to allow SheetColumn annotation to accept Column index as an alternate to Column name.

Pro: More flexible API, i.e., supports both Column name mapping as well as index based mapping
Con: Strongly depends on the order of the Columns. Object property to excel column mappings get invalid whenever the column order changes.

Will take it up as feature request for future releases.

@justhyno
Copy link

justhyno commented Nov 2, 2020

i had this issue too, i want read two column with same name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants