Open Narven opened 6 years ago
The error is correct indeed.
Above file contains CR line terminators(\r
). You can verify it with file <filename>
.
Currently Golang csv parser used by textql do not support CR line terminators. You should replace all occurrences of \r
with \n
. See this Golang Issue.
Thanks for the feedback.
Can't the tool just detect the CR and fix the file accordingly?
In my opinion, people that could use the tool don't care about CR... for them is just a csv file, they just want for it to work.
If someone just sees that error
... is going to immediately say... this tool is crap
, which is not the case (in my opinion), just incomplete. Either the error needs to be much more explanatory or just make the tool fix the CR issue.
Also if someone is going to use this tool is because they have really huge csv, and nobody is going to open them to replace \r
by \n
.
Just an opinion.
On this website there is some csv files that I downloaded to test textql (the first one)
https://support.spatialkey.com/spatialkey-sample-csv-data/
when I run
textql -sql "select count(*) from sample_data" FL_insurance_sample.csv
I get2018/04/09 13:57:58 too many columns on FL_insurance_sample
The file has huge amount of rows, but only contains 18 columns.
Is the error correct?