yq/operators/split-into-documents.md
2022-01-28 12:45:43 +11:00

334 B

Split into Documents

This operator splits all matches into separate documents

Split empty

Running

yq --null-input 'splitDoc'

will output


Split array

Given a sample.yml file of:

- a: cat
- b: dog

then

yq '.[] | splitDoc' sample.yml

will output

a: cat
---
b: dog