-
Notifications
You must be signed in to change notification settings - Fork 20
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
Wrongly parsed hash #44
Comments
Of course this might fall into "and does not deal with most formatting or more advanced functionality." category ... |
The problem in this file is that there are multiple cells in the header that are empty (B1, G1, K1, N1, P1). Hash keys in Ruby are unique, so there can be only one 'nil' key and that ends up with the value from P2. This is the unpredicted result the README mentiond:
As it stands, your best option is to use array mode ( If anybody can come up with a pull request to ignore the columns with empty header cells in hash mode, I'd be open to merging that. I don't have time to work on that myself right now, unfortunately. |
Right, thx for confirming my understanding. Not sure if I'll have motivation to dig into this myself ATM, because, as you suggested, I have already went with array mode any parsing headers by hand for the moment (and I could probably live also with just indices). Nevertheless, if I would have time, what would be your preferred solution?
|
I think it's reasonable to throw an error in cases where there are duplicate headers in hash mode. I could imagine wanting to be alerted of this rather than proceeding with potentially unintended behavior. My two cents. |
Right, I guess it's fair to raise an exception in this situation since the resulting data is useless as illustrated by this issue. I'll leave this issue open until we implement at least that. Alternatively I'd opt for option 3 out of @voxik 's suggestions above: by implementing a |
The hash parsing the F2022-10.xlsx is wrong:
The correct output should be:
I think that the parser is confused by the empty columns.
The text was updated successfully, but these errors were encountered: