I have very specific problem. This is the json file I have with me.
{
"name" : "myname",
"value" : 0,
"level" : [ {
"name" : "myname",
"value" : 1,
"level" : [ {
"name" : "something",
"value" : 2,
"level" : [ {
"name" : "something",
"value" : 3,
"level" : [ {
"name" : "Phy",
"value" : 4,
"something_retrive" : [ {
"mysupername" : "retrive",
"someID" : "blahblah"
}, {
"something_retrive" : [ {
"mysupername" : "retrive",
"someID" : "blahblah"
"randomdata" : [ {
"data1":"val1"
"data1":"val1"
}, {
"name" : "some",
"size" : 3,
"type" : "float",
} ]
} ]
} ]
} ]
} ]
} ]
}
I need to search through level inside level(Which can be of any numbers recursively) and I also need to know no. of them until I find "something_retrive" and in that also there can be more than one "mysupername" so I need to retrive some of them after knowing no. of "mysupername" available.
I'm using python right now and using them I'm able to load json and access the data using answers from this question Parsing json and searching through it
But I don't know How to perform searching and brwosing in JSON file and how to know that I'm at specific level.
Any help or suggestion or reference will be helpful.
(I searched for 2 days but no luck)