Get duplicate data from coll.

Loukas Perreault's icon

Hi!
I know this is the kind of topic that a lot of posts in this forum answers, but I can't get the exact information i'm looking for.

I have three colls (could be more) in which I have symbols.
Ex :
Coll 1 :
1, apple;
2, orange;
3, mango;
4, mulberry;

Coll 2 :
1, watermelon;
2, orange;
3, avocado;
4, apple;

Coll 3 :
1, orange;
2, strawberry;
3, papaya;
4, apple;

As you can see, "apple" and "orange" are in each of the colls.
I'd like to populate a new coll with only these two symbols.

Coll final :
1, apple;
2, orange;

I know there are some posts about removing the duplicates, but not so much about keeping the duplicates, and it's often about numbers, maybe I could do something with converting the symbols to ascii and itoa back when the duplicates are filtered but i can't seem to find the exact way of doing this...
Thanks in advance for your help!

tyler mazaika's icon

the zl/list object has modes for getting things in common between two lists. It works with symbols or numbers.

double_UG's icon

Please provide at least 10 characters

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

Loukas Perreault's icon

@Double_UG your approach seem to kind of do it! Thanks! The thing is that it puts every matching symbol on one coll line... But thank you for showing me the zl.sect!

Here is the example in context using filenames. The filenames that are identical are in bold (the colls will contain a lot of entries) :
Coll 1 :
1, AC_SLATER_bass_loop_pitchy_af_01_128_E.wav;
2, AC_SLATER_drum_fill_akai_127.wav;
3, DD_RAA_77_drums_loops_soul_hat_groove_heavy.wav;
4, UMRU_bass_one_shot_metal_G.wav;
5, DECAP_kick_one_shot_big_bop.wav;

Coll 2 :
1, AC_SLATER_drum_fill_akai_127.wav;
2, DECAP_kick_one_shot_big_bop.wav;
3, MdL_kick_flap.wav;
4, UMRU_bass_one_shot_metal_G.wav;
5, osr_clap_one_shot_high_harsh_malt.wav;

Coll 3 :
1, osr_bass_loop_ring_128_Cm.wav;
2, UMRU_bass_one_shot_808_soft_C.wav;
3, DECAP_melodic_one_shot_dark_windchimes_one_shot_Amin.wav;
4, OAK_loop_ey_bruh_listen_drums_152_Bmaj.wav;
5, DECAP_kick_one_shot_big_bop.wav;
6, UMRU_bass_one_shot_metal_G.wav;

In this case, the final coll would be :

Coll final :
1, DECAP_kick_one_shot_big_bop.wav;
2, UMRU_bass_one_shot_metal_G.wav;

Source Audio's icon

your coll final should have 3 entries
1, UMRU_bass_one_shot_metal_G.wav;
2, DECAP_kick_one_shot_big_bop.wav;
3, AC_SLATER_drum_fill_akai_127.wav;

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

Loukas Perreault's icon

That's the thing, I only want the namefiles that are in all 3 colls. I will go check out what you sent, thanks so much for your reply

Source Audio's icon

then you shoul have stated so, instead of duplicates.
If you now say only names that are contained in all 3 colls,
then use zl.sice 2 at output.
In theory, a singe coll could also have repeated names inside,
like :
1, AC_SLATER_bass_loop_pitchy_af_01_128_E.wav;
2, AC_SLATER_bass_loop_pitchy_af_01_128_E.wav;
17, AC_SLATER_bass_loop_pitchy_af_01_128_E.wav;

here is "tripple" detector

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


Loukas Perreault's icon

OMG @SOURCE AUDIO thank you sooo much!!! Yeah you are right my explanation was missing some key info. I will try and be more precise next time! That's really sweet of you that you took the time! Thank you again!