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

XlsxReader doesn't respect calculated tableArea for header column names #887

Closed
lujop opened this issue Mar 4, 2021 · 5 comments · Fixed by #926
Closed

XlsxReader doesn't respect calculated tableArea for header column names #887

lujop opened this issue Mar 4, 2021 · 5 comments · Fixed by #926
Labels

Comments

@lujop
Copy link
Contributor

lujop commented Mar 4, 2021

There is a buggy condition on some excels when there are blank columns at the start of the sheet.

When es.decide.toolbox.util.XlsxReader#createTable calculates header names it uses a for(Cell cell : row) instead of using the supplied tableArea parameters.

And when there are some blank columns it doesn't always work. I don't know exactly why, but sometimes the first blank column is discarded in the iterator, but sometimes although all values are blank poi maintains the column, and the code doesn't work correctly detecting the header column names.

To calculate the header column names the code should use the tableArea.startColumn and tableArea.endColumn

@lujop
Copy link
Contributor Author

lujop commented Mar 4, 2021

I will be happy to provide a PR for this if it's recognized as an issue.

@lwhite1
Copy link
Collaborator

lwhite1 commented Mar 29, 2021

If you want to submit a PR with good test coverage, that would be great.

@DanielMao1
Copy link
Contributor

@lujop Hello, bro, do you still work on this issue? I have encountered the same problem and got some ideas to fix this bug. If you are busy, I can work on this issue.

@lujop
Copy link
Contributor Author

lujop commented Apr 24, 2021

Thanks, @DanielMao1, just yesterday I got some time to do some work on a proposition for some reader-related issues that I've not yet finished but I will try to make a PR this weekend.
If you're in a hurry just do, and if not, and can wait this weekend I will try to submit.

@DanielMao1
Copy link
Contributor

Thanks, @DanielMao1, just yesterday I got some time to do some work on a proposition for some reader-related issues that I've not yet finished but I will try to make a PR this weekend.
If you're in a hurry just do, and if not, and can wait this weekend I will try to submit.

OK, here you go. I am not in so hurry to do PR. You can go ahead on this issue anyway :).

@lwhite1 lwhite1 added the excel label May 4, 2021
lujop added a commit to lujop/tablesaw that referenced this issue May 5, 2021
@lujop lujop mentioned this issue May 5, 2021
1 task
lwhite1 pushed a commit that referenced this issue May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants