Repository navigation
|
Consider below input yaml I want to convert it to below csv I tried below and more - didn't work. I understand for csv to work, it has to be array of arrays like below, No header but still ok. Is there a way to convert |
Answered by
mikefarah
Jul 29, 2022
Replies: 1 comment 2 replies
|
Good question - I should update the guide with this example. yq '[["name", "species", "color"]] + [.items[] | [.name, .species, .color]]' examples/data1.yaml -o=csvname,species,color
Tom,cat,blue
Jim,dog,brown |
2 replies
Answer selected by
balki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good question - I should update the guide with this example.
yq '[["name", "species", "color"]] + [.items[] | [.name, .species, .color]]' examples/data1.yaml -o=csv