You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[davidp@supernova:~]$ q -H 'select * from test.csv where col1 = 3'
Traceback (most recent call last):
File "/usr/bin/q", line 1940, in <module>
run_standalone()
File "/usr/bin/q", line 1664, in run_standalone
default_delimiter = get_option_with_default(
File "/usr/bin/q", line 1658, in get_option_with_default
return p.get('options', option).decode('string-escape')
AttributeError: 'str' object has no attribute 'decode'
I almost always use q to query CSV files, and it's a bit annoying to have to tell it every time that the file uses commas as delimiters, otherwise:
[davidp@supernova:~]$ cat test.csv
"col1","col2"
1,2
3,4
5,6
[davidp@supernova:~]$ q -H 'select * from test.csv where col1 = 3'
Warning: column count is one - did you provide the correct delimiter?
Bad header row: Header must contain only strings and not numbers or empty strings: 'col1,"col2"'
'col1,"col2"': Column name cannot contain commas
The text was updated successfully, but these errors were encountered:
I'd installed the most recent distro-packed version, both on a Debian box and a Ubuntu 20.04.4 LTS workstation, and both got a much older version:
[davidp@supernova:~]$ q -v
q version 1.8
Copyright (C) 2012-2017 Harel Ben-Attia (harelba@gmail.com, @harelba on twitter)
http://harelba.github.io/q/
Having upgraded them to a non-prehistoric version (3.1.6 from the .deb download), all is well and the config file is recognised and I don't have to supply the delimiter every time.
Thanks for the prompt response, and thanks for a rather awesome tool!
I may be missing something obvious but is there a way to set the default delimiter in the config?
I've tried what seems obvious:
but it explodes:
I almost always use
q
to query CSV files, and it's a bit annoying to have to tell it every time that the file uses commas as delimiters, otherwise:The text was updated successfully, but these errors were encountered: