Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection of output delimiters #2348

Closed
koraa opened this issue Sep 12, 2021 · 1 comment
Closed

Selection of output delimiters #2348

koraa opened this issue Sep 12, 2021 · 1 comment

Comments

@koraa
Copy link

koraa commented 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"))'

@koraa koraa changed the title Streaming processing of stdin Selection of input output delimiters in raw mode Sep 12, 2021
@koraa koraa changed the title Selection of input output delimiters in raw mode Selection of output delimiters Sep 12, 2021
@koraa
Copy link
Author

koraa commented Sep 12, 2021

Argh! Just found #1271 and #965

@koraa koraa closed this as completed Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant