I need to extract a piece of information out of an output of a previously ran command in my terminal. And this output is in a JSON format, so this is an object wrapped in {} and [] and other chars.
Within those brackets there are several fields which have names and their respective values. Something like the example below:
Code: Select all
Result:
[ (array of json object)
{
"txid" : "txid",
"vout" : n,
"address" : "address",
"label" : "label",
"scriptPubKey" : "key"
"amount" : x.xxx,
"confirmations" : n,
"redeemScript" : "script"
"witnessScript" : "script"
"spendable" : xxx,
"solvable" : xxx,
"desc" : xxx,
"safe" : xxx
}
,...
]
Can this be one with 'sed', 'awk' or any other way?