I have a JSON file which contains a structure like this:
[
{
"name": "folder1",
"children": [
{
"name": "file1",
"value": "value1"
},
{
"name": "folder2",
"children": [
{
"name": "file2",
"value": "value2"
}
]
}
]
},
{
"name": "file3",
"value": "value3"
}
]
I want to print full paths and values of every file using jq. For example, with input from above:
folder1/file1 - value1
folder1/folder2/file2 - value2
file3 - value3
Is such thing possible? I haven't found any obvious way to do it, while reading the jq manual and StackOverflow answers about recursive search in jq.