Dictionary in dictionary, Push to Coll, saving with different suffix

Sjoerd's icon

Hello,

Ultimately, I am looking for a way to save my dictionary with a different suffix as the default .JSON
Since 'dict' couldn't do the task and 'coll' can, I found out that I have to go the 'coll' way. I managed to push the information from my dict to a coll. But... I have sub-dictionaries in my main dictionary and do not know how I can get this data saved in my coll as well. Anyone?

Max Patch
Copy patch and select New From Clipboard in Max.

njw's icon

Does anyone have an answer to this? I am now parsing .json dictionaries to COLL that have sub dictionaries and, whilst COLL lists the parent dictionary, it doesn't unpack the sub-dictionaries. Does anyone know how to parse ALL dictionaries and sub-dictionaries to COLL form .json files?

Many thanks.

Floating Point's icon

I strongly suspect this is not possible. For one simple reason: coll is a flat data structure, it has no capacity to represent nested structures. The only way you could do it is to create a heirarchy of colls that reflect the structure of your json data, with a different coll for each (sub-)dictionary, and have a parent coll that refers to the "sub-colls". I suspect this is not the way you'd want to go, as you'd have to design a whole process to parse the data, and use scripting to create and dispose of colls as the data is parsed/changed.