mikefarah / yq

yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
https://mikefarah.gitbook.io/yq/
MIT License
12.36k stars 602 forks source link

extract a map of filename: content to multiple files with key as name and content as content #2032

Closed dtcopcp closed 5 months ago

dtcopcp commented 6 months ago

This feels like it might be trivial, apologies if it is.

If I can filter down to a map in the form:

filename1.json: {"some":"json"}
filename2.json: {"some":"json"}

how can I split this into two files: filename1.json and filename2.json with only the json as content?

Thanks