Hello, I am working on a project that relies on data from a web service that returns a large JSON file, which I save to an SD card. I have an array of IDs and I need to find the matching IDs in the JSON file and read out the parameters that correspond to those IDs. Now, the problem I'm having is that the JSON file is around ~6 MB, so it won't fit into RAM. I could filter the JSON, but the data I need is in one very large array of objects, so I can't reduce it a lot. I looked online, and it seems that I should read and parse the JSON in chunks, but I didn't find any examples of that.
The JSON looks something like this:
{
"data": {
"objects": [{
"id": 239089060,
"Data1": 97115,
"Data2": 1239083487237,
"Data3": 169874830,
"Data4": 1643904238090,
"neededData": 360
}, {
"id": 560213034,
"Data1": 54987,
"Data2": 4895203781411,
"Data3": 154856257,
"Data4": 5812348902040,
"neededData": 125
}, {
"id": 432904509,
"Data1": 76751,
"Data2": 0987206196125,
"Data3": 465145478,
"Data4": 5498347519757,
"neededData": 99
}
]
}
}
If I have, for example, an ID array that has the values: 239089060, 432904509.
It should create another array with the values: 360, 99.
In reality there are around 5000 objects in the "objects" array, and my ID array will contain about 50 values.
Any ideas on how to accomplish this would be helpful.
If there is any information I am missing, let me know. Thank you in advance for your help.