reorganising data in a COLL object

iolli's icon

Hi everyone,

i need the coll object to restore data in the following way.

After having stored for example

60, 10 1 200;
61, 10 2 300;
62, 10 1 300;
63, 10 2 300;

i need coll to change the index and to reorganize all lists grouping all elements for the common new index.

first element used as index:

10, 60 1 200 61 2 300 62 1 300 63 2 300;

second element used as index:

1, 60, 10 200 62 10 300;
2, 61, 10 300 63 10 300;

third element used as index:

200, 60 10 1;
300, 61 10 2 62 10 1 63 10 2;

the order of the single elements in the list doesn't really matter...

Any suggestions?

Thank you very much!

Floating Point's icon

sounds like you need to use a database-style structure

if you search sqlite in the forums you might get a few more leads....

also if you're using max6 you might be able to work with the dict range of objects to do what you want...

iolli's icon

Hi,
thanks a lot for your help.

I'm new to max and I'm not able to get into SQL.

Do you think it is possible to make this kind of analysis just in max?

Thanks a lot!

Floating Point's icon

Do you think it is possible to make this kind of analysis just in max?
yes it is possible without extensions such as sqlite
if you've got max 6 then study the dict suite of objects
if you don't want to do this then here's a few suggestions:
-look at how you can sort your coll data (sort message)
-look at how you can iteratively process the coll data using uzi, using the length message to query the size of the coll and initialize the uzi
- a coll can reference another coll
--a coll can have more than one instance of itself
-repackage the data using the list operations found in the zl suite of objects (slice, join etc)
- do your patching in small chunks, one aspect at a time, making sure you get one thing right before moving on to the next

Luke Hall's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Something like this works pretty well too: