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

jsonlines Input format #498

Open
s4ke opened this issue Feb 20, 2021 · 1 comment
Open

jsonlines Input format #498

s4ke opened this issue Feb 20, 2021 · 1 comment

Comments

@s4ke
Copy link

s4ke commented Feb 20, 2021

First of all, nice and simple tool, but tt would be great if jfq would support the jsonlines format as input just as it supports it as an output format. This would make it the perfect tool for data transformation pipelines in bash.

I will be working on a pull request.

@s4ke
Copy link
Author

s4ke commented May 21, 2021

@blgm Something that I found out while working with the new feature a bit:

You can't use ndjson/jsonlines-output to convert an input array:

[
    {...},
    {...}
]

into a sequence of elements separated by newlines by passing it into jfq "$" --jsonlines-output/ndjson. Looking into the code I am not so sure as to how to achieve this behaviour properly though. The thing is that since we can never be sure what the jsonata would produce, we can not just check if the output is an array and then just go from there.

I don't think that this is solveable out of the box, however and we should advise all users to be aware of this edge case.

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