mirror of
https://github.com/wader/fq.git
synced 2024-12-01 19:12:34 +03:00
e3ae1440c9
Feels less cluttered, easier to read and more consistent. Still keep tovalue, tobytes etc that are more basic functions this only renamed format related functions. Also there is an exceptin for to/fromjson as it comes from jq. Also fixes lots of spelling errors while reading thru.
44 lines
825 B
Plaintext
44 lines
825 B
Plaintext
/probe1.jsonl:
|
|
{"a": 123} [123]
|
|
/probe2.jsonl:
|
|
{"a": 123}
|
|
[123]
|
|
/single.jsonl:
|
|
{"a": 123}
|
|
/error.jsonl:
|
|
{"a": 123} asd
|
|
$ fq . probe1.jsonl
|
|
[
|
|
{
|
|
"a": 123
|
|
},
|
|
[
|
|
123
|
|
]
|
|
]
|
|
$ fq . probe2.jsonl
|
|
[
|
|
{
|
|
"a": 123
|
|
},
|
|
[
|
|
123
|
|
]
|
|
]
|
|
$ fq -d jsonl . single.jsonl
|
|
[
|
|
{
|
|
"a": 123
|
|
}
|
|
]
|
|
$ fq -d jsonl . error.jsonl
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: error.jsonl (jsonl)
|
|
| | | error: jsonl: error at position 0xf: invalid character 'a' looking for beginning of value
|
|
0x0|7b 22 61 22 3a 20 31 32 33 7d 20 61 73 64 0a| |{"a": 123} asd.|| gap0: raw bits
|
|
$ fq -n '[{"a":123}, [123]] | to_jsonl'
|
|
"{\"a\":123}\n[123]\n"
|
|
$ fq -n '123 | to_jsonl'
|
|
exitcode: 5
|
|
stderr:
|
|
error: to_jsonl cannot be applied to: number (123)
|