Flatten
This recursively flattens arrays.
Flatten
Recursively flattens all arrays
Given a sample.yml file of:
- 1
- - 2
- - - 3then
yq 'flatten' sample.ymlwill output
- 1
- 2
- 3Flatten with depth of one
Given a sample.yml file of:
- 1
- - 2
- - - 3then
will output
Flatten empty array
Given a sample.yml file of:
then
will output
Flatten array of objects
Given a sample.yml file of:
then
will output
Last updated
Was this helpful?