1
1
mirror of https://github.com/wader/fq.git synced 2024-12-21 04:11:55 +03:00
fq/format/csv/testdata/csv.fqtest
Mattias Wadman cae288e6be format,intepr: Refactor json, yaml, etc into formats also move out related functions
json, yaml, toml, xml, html, csv are now normal formats and most of them also particiate
in probing (not html and csv).

Also fixes a bunch of bugs in to/fromxml, to/fromjq etc.
2022-07-23 21:48:45 +02:00

48 lines
548 B
Plaintext

/test:
1,2,3
$ fq -d csv . /test
[
[
"1",
"2",
"3"
]
]
$ fq -i
null> "a,b,c,d" | fromcsv | ., tocsv
[
[
"a",
"b",
"c",
"d"
]
]
"a,b,c,d\n"
null> "a,\"b, c\",d" | fromcsv | ., tocsv
[
[
"a",
"b, c",
"d"
]
]
"a,\"b, c\",d\n"
null> "a\t\"b\t c\"\td" | fromcsv({comma:"\t"}) | ., tocsv({comma: "\t"})
[
[
"a",
"b\t c",
"d"
]
]
"a\t\"b\t c\"\td\n"
null> [[bsl(1;100)]] | tocsv | ., fromcsv
"1267650600228229401496703205376\n"
[
[
"1267650600228229401496703205376"
]
]
null> ^D