Support spaces in tables/files names
I haven't found a way to use files with spaces in their name: quoting with ", ', or ` doesn't work; escaping spaces with a backslash doesn't work either.
Hi, yes, you're right it is a bug. I'll try to fix it as soon as possible.
Btw, which os are you using? On Sep 24, 2013 6:47 PM, "Thomas Riccardi" [email protected] wrote:
I haven't found a way to use files with spaces in their name: quoting with ", ', or ` doesn't work; escaping spaces with a backslash doesn't work either.
— Reply to this email directly or view it on GitHubhttps://github.com/harelba/q/issues/4 .
Among other things Ubuntu 10.04.
Thanks.
In standard ansi SQL you can use backticks to quote table and column names. Would be great if you could do that in q, too. E.g.:
q "SELECT * FROM `a file with spaces.csv`"
@kc14 yeah, filenames with spaces are currently a limitation of q. I have plans to have a solution for it for a long time now, but haven't gotten to it.
Ran into this again tonight. q is such a great utility. @harelba have any ideas for a fix to support spaces in names (I expected back ticks to work as that's the mechanism that works today for spaces in column names, but no joy).
@contentfree They are working, but depending on your shell you have to quote or escape them correctly (e.g. see https://github.com/harelba/q/issues/94#issuecomment-273985876)
Single quotes for the query and double quotes for the filename-with-spaces didn't work. Still breaks on spaces in the filename. I'll double check tomorrow that my version is the latest though.
On Apr 28, 2021, at 23:19, David Ongaro @.***> wrote:
@contentfree They are working, but depending on your shell you have to quote or escape them correctly (e.g. see #94 (comment))
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
unfortunately, my parsing logic doesn't support this for now.
I'm in the final phases of a huge upgrade for q which should be out soon, so i can't touch anything else for now.
I'll try to fix the issue immediately after the release.
Exciting news!
Single quotes for the query and double quotes for the filename-with-spaces didn't work. Still breaks on spaces in the filename. I'll double check tomorrow that my version is the latest though. … On Apr 28, 2021, at 23:19, David Ongaro @.***> wrote: @contentfree They are working, but depending on your shell you have to quote or escape them correctly (e.g. see #94 (comment)) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I was referring to "spaces in column names", for filenames you're out of luck I'm afraid. In most shells you may try a workaround like
q "SELECT * FROM "<(cat "a file with spaces.csv")
or
q "SELECT * FROM -" <"a file with spaces.csv"