-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Raw lines to an array of lines? #563
Comments
|
Use split/1: But as shown above you might have to be careful about trailing carriage returns. |
|
Thanks for the tip. |
|
|
|
|
|
If your jq has |
|
How about using the |
|
@pkoppstein Awesome solution, but I would like to ask:
|
|
@lorenzogrv Unless specifying the |
|
@itchyny oh, I see. Thx 😄 |
Is there a way to convert multiline, non-JSON input to a JSON array of lines in one invocation of
jq?Desired result:
Failed attempts:
I did manage to get the result that I want, but only by using
--raw-inputand--slurpseparately:Is that the preferred way?
The text was updated successfully, but these errors were encountered: