So far I have had no problems converting standard JSON to CSV with jq in the past. But now my data becomes complicated.
Major base tags are account and subaccount. All other values are variables. The entry year got variable values and changed by time very often. That's my task I can't solve.
Here is the output
{
"jsonrpc": "2.0",
"result": {
"current": [{
"number": 171883808,
"commission": 10,
"year": [
[1999, 9224, 0],
[2000, 41919, 9224],
[2001, 162945, 41919],
[2002, 397993, 162945],
[2003, 751570, 397993],
[2004, 886466, 751570]
],
"status": true,
"last": 9782473,
"account": "VFUIJOPQW",
"subaccount": "BLPORDGS"
}, {
"number": 69999012,
"commission": 15,
"year": [
[2012, 97587, 0],
[2013, 472685, 97587],
[2014, 605963, 472685],
[2015, 698634, 605963],
[2016, 1931094, 1745922]
],
"status": true,
"last": 9782490,
"account": "VFUIJOXXX",
"subaccount": "BLPORXXX"
}],
"id": 1
}
}