-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error when column has colon in the column (:) name #11
Comments
Right, that's sort of by design because csv-nix-tools assumes an extension to the CSV format, where the colon in the column name is a type delimiter - if there's no type after :, it doesn't know what to do. This extension is crucial for many things to work (like sorting numerically or filtering numerical columns using e.g. greater-than operator), so I'm not sure what should be done about it. One way would be to have a command line switch, which disables type parsing, but that doesn't really solve the real issue. Ignoring type parsing problems (here, it's just an empty string) could be an option, but I don't like when tools fail silently... Sorry for taking so much time to reply. I'm in the middle of a sort of hurricane right now ;). |
Hi @mslusarz thanks for your answer, hope you're fine. I never heard of that csv extension until now, i just looked around and only found this but it seems to add the types also in the cells.
|
I implemented it like you proposed in #12. I have to write more tests for that, so only PR for now. |
I am trying to csv-sqlite to perform some cleanup on a csv file, and I'm having trouble when loading a csv with a colon in the name:
#no issue here echo "ID,Title,test" > a.csv cat a.csv | csv-sqlite "select * from input" -s #error here echo "ID,Title,test:" > a.csv cat a.csv | csv-sqlite "select * from input" -s #error here echo "ID,Title,\"test:\"" > a.csv cat a.csv | csv-sqlite "select * from input" -s
It prints the message:
And exits with exit code 2, I tried with current trunk (a39e4e6)
The text was updated successfully, but these errors were encountered: