I have the below JSON file, with the data stored as columns enumerated by rank
in an array:
{
"data": [
{
"displayName": "First Name",
"rank": 1,
"value": "VALUE"
},
{
"displayName": "Last Name",
"rank": 2,
"value": "VALUE"
},
{
"displayName": "Position",
"rank": 3,
"value": "VALUE"
},
{
"displayName": "Company Name",
"rank": 4,
"value": "VALUE"
},
{
"displayName": "Country",
"rank": 5,
"value": "VALUE"
}
]
}
I would like to have a CSV file in this format, where the header come from the value of a column's displayName
and the data in the column is the singular value
key's value:
First Name, Last Name, Position, Company Name, Country
VALUE, VALUE, VALUE, VALUE, VALUE
Is this possible by using only jq
? I don't have any programming skills.