This recursively flattens arrays.
Recursively flattens all arrays
Given a sample.yml file of:
- 1 - - 2 - - - 3
then
yq 'flatten' sample.yml
will output
- 1 - 2 - 3
Last updated 3 years ago
yq 'flatten(1)' sample.yml
- 1 - 2 - - 3
- []
[]
- foo: bar - - foo: baz
- foo: bar - foo: baz