Does yq have an equivalent to jq --slurp?
#2547
Unanswered
polarathene
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Similar to #1636 , there is also some issues like this one with solutions that do a merge of files into a top-level array or object via reduce:
It would be nice if there was a command flag that merged the inputs into a single array like
jqcan via--slurp?jqcomparisonarg-1.json:{ "arg": "hello" }arg-2.json:{ "arg": "world" }With
yqand lists:One could try with the object files already as list items and try to go from there?
arg-1.yaml:arg-2.yaml:yq ea/yq eval-allenables the functionality but makes no assumptions, requiring you to do the extra step to get the array of inputs combined (similar to the docs "merge all files" example but slight change for merging files when they're a top-level array instead of object):Beta Was this translation helpful? Give feedback.
All reactions