Posted By: AndrewAMD
DataParse - support for eccentric JSON data - 01/13/19 21:57
jcl,
I have JSON data that looks like this. I pulled it from the Darwinex API. I was hoping to have a blog entry, where I demonstrate Zorro's ability to download and parse JSON data with nothing more than a Zorro script, but maybe I will need to make and load a DLL too.
It also does not help that it starts with an eccentric element at the beginning of the array.
I'm thinking that in the future, it might be helpful for dataParse to support a format such as this:
Can this go on the to-do list?
Thanks,
Andrew
I have JSON data that looks like this. I pulled it from the Darwinex API. I was hoping to have a blog entry, where I demonstrate Zorro's ability to download and parse JSON data with nothing more than a Zorro script, but maybe I will need to make and load a DLL too.
It also does not help that it starts with an eccentric element at the beginning of the array.
Code:
{ "candles": [ { "timestamp": 1532638800 }, { "candle": { "close": 1045.31, "max": 1045.31, "min": 1045.31, "open": 1045.31 }, "timestamp": 1532898000 }, { "candle": { "close": 1038.23, "max": 1046.22, "min": 1037.03, "open": 1045.31 }, "timestamp": 1532984400 }, { "candle": { "close": 1025.54, "max": 1042.31, "min": 1025.54, "open": 1038.3 }, "timestamp": 1533070800 }, // etc etc
I'm thinking that in the future, it might be helpful for dataParse to support a format such as this:
Code:
const char* format = "candles,timestamp,%t,candle->max,candle->min,candle->open,candle->close"; int numparsed = dataParse(h,format,filename); printf("nnumparsed = %d",numparsed);
Can this go on the to-do list?
Thanks,
Andrew