Yes of course. Once you can sort items of any type you can sort aggregate items, structs, sublists or whatever on one of their elements. Its a little messy in Pd. The best way might be to use pointers and try to do the classic Kernighan and Richie head swap thing but I have no idea how to exchange pointers in Pd.
This attached thing should do the job and be adaptable to variable record lengths. You might be able to hack it to work with symbols as well as floats.
It totally fails if the keys are not ubique though :(
a.
On Wed, Mar 14, 2012 at 03:26:14PM -0700, Benoît Fortier wrote:
Thanks Andy. But as far as I know, [list-sort] will sort the number in a list, and what I really need is to sort multiple lists according to their first element (which are numbers)... is there a trick with [list-sort] that allows to do that?
Benoît
De : Andy Farnell padawan12@obiwannabe.co.uk à: Benoît Fortier benoitfortier@yahoo.ca Cc : pd-list pd-list@iem.at Envoyé le : mercredi 14 mars 2012 18h17 Objet : Re: [PD] store and manipulate multiple lists
[list sort]
maybe?
a.
On Wed, Mar 14, 2012 at 03:04:25PM -0700, Benoît Fortier wrote:
Hi everybody,
I need to store multiple lists of numbers in a text file in a specific order : the first number of each list must be ascending, from the first line of the text file to the last. The problem is this : my patch outputs the lists in an unordered way. I could rewrite the patch so that the lists gets outputed the correct way, but to be able to store all the lists somehow and then write a patch to order them afterward feels to me like a much more elegant solution. Any toughts on this?
Thank you all, this list has been very helpfull to me, and its also quite entertaining!
Benoît
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list