I have the following nested JSON file labs.json
with variable keywords (lab001
, lab002
, etc.) which I would like to convert into a TSV using jq
:
{
"lab001": {
"tags": {
"T1": [],
"T2": ["k26","e23"],
"T3": ["s92"]
},
"code": "8231"
},
"lab002": {
"tags": {
"T1": ["t32","y55"],
"T2": ["q78"],
"T3": ["b24"]
},
"code": "9112"
}
}
The resulting table should look like:
ID | T1 | T2 | T3 |
---|---|---|---|
lab001 | k26,e23 | s92 | |
lab002 | t32,y55 | q78 | b24 |