Turn a very long list into a symbol or to beak it up based on repeating symbol?

electriceel's icon

Hi all,

I have a very long list thousands of symbols long which I'm trying to send to dict.deserialize. The data concerns the status of 101 bike stands in a city bike share scheme. I am taking it in real time from an API and have stripped it down to the {key:value key:value key:value} format which dict.deserialize accepts.

The data contains 14 keys which repeat 101 times, 1 of each key per bike station. So my list is over 4000 symbols long, and far more characters than tosymbol allows! When I pass the entire message to dict.deserialize, only the final 14 keys and values are stored in the dict - ie just the data for the last station in the list. Can anyone think why that is?

If I can turn the list into a symbol, or find a way to prepend and append the list with quotation marks ("), without adding the spaces that [append] and [prepend] produce, I could then use [fromsymbol @separator] to then break the data up into individual stations. But I'm at a loss at...

Thanks for your help!

electriceel's icon

I suspect the last 14 are only being stored because JSON wont allow the same key to be repeated over and over? So I either need to break the list up before creating the dictionaries, or create sub dictionaries for each station?