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
I think jq is pretty damn useful as a general text processor (i.e. functional replacement for grep and sed).
Simple cases such as grepping for a line are easy echo -e "foo\nbar\nbaz" | jq -Rr 'select(test("a"))'.
Other cases like using a different delimiter are more because I need to manually split the input: echo -en "foo\0bar\0baz\0" | jq -Rsrj 'split("\u0000") | map(select(test("a")) | . + "\u0000") | .[]'
It would be nice if jq provided parameters to explicitly select input and output parameters so I can write: echo -en "foo\0bar\0baz\0" | jq -Rs -d'\0' -D'\0' 'map(select(test("a"))'
The text was updated successfully, but these errors were encountered:
koraa
changed the title
Streaming processing of stdin
Selection of input output delimiters in raw mode
Sep 12, 2021
koraa
changed the title
Selection of input output delimiters in raw mode
Selection of output delimiters
Sep 12, 2021
Morning,
I think jq is pretty damn useful as a general text processor (i.e. functional replacement for grep and sed).
Simple cases such as grepping for a line are easy
echo -e "foo\nbar\nbaz" | jq -Rr 'select(test("a"))'
.Other cases like using a different delimiter are more because I need to manually split the input:
echo -en "foo\0bar\0baz\0" | jq -Rsrj 'split("\u0000") | map(select(test("a")) | . + "\u0000") | .[]'
It would be nice if jq provided parameters to explicitly select input and output parameters so I can write:
echo -en "foo\0bar\0baz\0" | jq -Rs -d'\0' -D'\0' 'map(select(test("a"))'
The text was updated successfully, but these errors were encountered: