I have the following YAML document:
222:
description:
en: "124098-en"
fr: "498438-fr"
name:
en: "293878-en"
fr: "222493878-fr"
mass: 0.1
groupID: "24902"
223:
description:
en: "124098-en"
fr: "498438-fr"
name:
en: "zz325-en"
fr: "222493878-fr"
mass: 0.1
groupID: "234988"
[many other records]
I would like to construct a CSV that looks like:
222,"293878-en","24902"
223,"zz325-en","234988"
That is, each row is just:
- first field: the key of the map in the original document
- second field: the
.[].name.enfrom the original document - third field: the
.[].groupIDfrom the original document
No other fields are preserved in the CSV from the original document.
What's the right way to do this?
Addendum: I'm using the Go version of yq (4.7.1) but either the Go or the Python version is fine, or if that's not the right tool here, I'm happy to use something else.