How to get fields information from stdin ? #70
-
I'm trying something like |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 5 replies
-
RTFM
EL
—
Sent from Dr Lisse’s iPhone/iPad
…On 6. Dec 2021, 11:57 +0200, Kroum Tzanev ***@***.***>, wrote:
I'm trying something like cat mydata.csv | csvq fields but I can't get the desired result. Is there an option to indicate that the file is stdin?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
-
Look at the the SELECT clause.
el
On 06/12/2021 12:49, Kroum Tzanev wrote:
@ondohotola I looked in the manual but I couldn't find how to do it
(if it's possible). It seems that |csvq fields| requires a filename
and that |stdin| is not supported.
[...]
…--
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
Book your Covid-19 Vaccination at https://c19.idtoday.com.na
|
Beta Was this translation helpful? Give feedback.
-
You'll probably have to generate a temporary file and read that. el |
Beta Was this translation helpful? Give feedback.
-
The manual quite clearly if short, in my view and from retrospect, shows
that a file name is required.
…On 06/12/2021 14:09, Kroum Tzanev wrote:
@ondohotola <https://github.com/ondohotola> That's not what I was
asking. I know I can generate a temporary file. After your kind
"RTFM", I was hoping you knew how to read from stdin for the |fields|
subcommand.
--
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
Book your Covid-19 Vaccination at https://c19.idtoday.com.na
|
Beta Was this translation helpful? Give feedback.
-
The fields subcommand does not have such an option. However, you can use SHOW command as a query.
https://mithrandie.github.io/csvq/reference/built-in.html#show_fields |
Beta Was this translation helpful? Give feedback.
-
And it's even in the Manual :-)-O
el
On 06/12/2021 14:27, Kroum Tzanev wrote:
@mithrandie Thanks ! This is what I was looking for 😃
[...]
…--
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
Book your Covid-19 Vaccination at https://c19.idtoday.com.na
|
Beta Was this translation helpful? Give feedback.
-
And tell you to RTFM, therafter?
el
On 06/12/2021 16:23, Kroum Tzanev wrote:
@ondohotola So you should RTFM before to try to answer 😉
[...]
…--
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
Book your Covid-19 Vaccination at https://c19.idtoday.com.na
|
Beta Was this translation helpful? Give feedback.
The fields subcommand does not have such an option. However, you can use SHOW command as a query.
cat mydata.csv | csvq ‘SHOW FIELDS FROM STDIN’
https://mithrandie.github.io/csvq/reference/built-in.html#show_fields