What is the preffered CSV format for csvq? #85
Replies: 3 comments
-
On my mac with the file saved as t.csv
csvq -d ';' 'select * from t'
+------+------+------+
| ColA | ColB | ColC |
+------+------+------+
| 1 | xxx | 111 |
| 2 | yyy | 222 |
| 3 | zzz | 333 |
+------+------+------+
el
…On 2022-10-02 21:00 , githubuser181226 wrote:
hello.
csvq gives me "syntax error unexpected token" errors when querying my
csv file formatted like below:
"ColA";"ColB";"ColC"
1;"xxx";111
2;"yyy";222
3;"zzz";333
I wrap all text values (NOT numbers) with doublequotes and semicolon ;
is my preffered separator (because I use , in floating points).
first row contains field names.
what am I doing wrong?
please help.
cheers.
—
Reply to this email directly, view it on GitHub
<#85>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACVZVGR6WH5B7NCZQQT6V4TWBHLU7ANCNFSM6AAAAAAQ3ASIMM>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Dr. Eberhard W. Lisse \ / Obstetrician & Gynaecologist
***@***.*** / * | Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht \ / If this email is signed with GPG/PGP
10007, Namibia ;____/ Sect 20 of Act No 4 of 2019 may apply
|
Beta Was this translation helpful? Give feedback.
-
Hi. Thanks for a tip on -d switch. Just to conclude. Apparently I made a mistake by naming my csv files with numbers only, which means table names are numbers only, which csvq of course does not support, and that was the main reason of the error. After fixing that and using -d switch program works as expected. Though if I want to change that separator permantently, I use db.bat like this: Is there another way of setting csvq defaults, perhaps a csvq.ini file? |
Beta Was this translation helpful? Give feedback.
-
By placing pre-loaded statements in a specific file, these statements are executed first at runtime. For example, by creating a file named $HOME/.csvqrc and writing the following, the delimiter can be set to ';' without specifying any options each time.
Pre-Load Statements: https://mithrandie.github.io/csvq/reference/command.html#configurations |
Beta Was this translation helpful? Give feedback.
-
hello.
csvq gives me "syntax error unexpected token" errors when querying my csv file formatted like below:
I wrap all text values (NOT numbers) with doublequotes and semicolon ; is my preffered separator (because I use , in floating points).
first row contains field names.
what am I doing wrong?
please help.
cheers.
Beta Was this translation helpful? Give feedback.
All reactions