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

Ignore unequal length of columns #54

Closed
muuuh opened this issue Apr 29, 2021 · 3 comments
Closed

Ignore unequal length of columns #54

muuuh opened this issue Apr 29, 2021 · 3 comments

Comments

@muuuh
Copy link

muuuh commented Apr 29, 2021

Hello,

thank you for csvq!

Is it possible to add a feature to ignore unequal length of columns in a csv-file?

csvq -d ',' fields "test.csv"

results to

data parse error in file test.csv: line 2, column 0: wrong number of fields in line

It seems to be described here:
https://stackoverflow.com/questions/34008600/handle-a-specific-error-in-golang

Thank you and best regards,

@mithrandie
Copy link
Owner

mithrandie commented Apr 30, 2021

It's possible, but I think it is not a desirable feature because the behavior prevents users from noticing data corruption, and such corrupted data should be fixed by users before running queries.
So I don't make it the default behavior, but if you want to be able to specify it as a command option, I'll consider it.

@muuuh
Copy link
Author

muuuh commented Apr 30, 2021

I agree that this cannot be the default value and that the hints are helpful. However, it would be helpful as an optional setting to analyze certain data anyway. Maybe you could consider it. In any case, thank you.

mithrandie added a commit that referenced this issue May 5, 2021
- Allow same table names on both sides of set operators. ([GitHub #53](#53))
- Add the command option "--allow-uneven-fields". ([GitHub #54](#54))
- Fix a bug in parsing of set operations.
@mithrandie
Copy link
Owner

The command option "--allow-uneven-fields" has been added in the version 1.15.1.

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

No branches or pull requests

2 participants