My problem is similar to your case b. Maybe I shoud mention at this point that the lists are midi messages, and the first number of each lists are timestamps.

I'm looking for a solution within pd. I shall have a look at all your suggestions, they look all very good. The [coll] object seems to be the easiest solution to adapt to my patch, but I don't like the fact that the [sort< fonction strips out the number it uses to do sorting, in my case the timestamp which is off course an important information. But well, thats quite easy to fix.

For your interest, the goal of the patch is to create a text file which will be converted into a midi file using [seq]. It seems that [seq] works well only with sequentially ordered midi messages.

Thanks again
Benoît



De : Lorenzo Sutton <lorenzofsutton@gmail.com>
À : pd-list@iem.at
Envoyé le : jeudi 15 mars 2012 8h41
Objet : Re: [PD] store and man

On 14/03/12 23:04, 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?
For me it is not very clear if:

a. your patch outputs some unordered lists for which you want to save the produced order E.g.
[x y z(
[z x y(
[a b c(

should be written to the text file in that order
1 x y z;
2 z x y;
3 a b c;

or

b. your patch outputs lists like
[3 x y z(
[1 z x y(
[2 a b c(
in an unknown order and you want to save them in the text file as:
1 z x y;
2 a b c;
3 x y z;

In case a. it's quite trivial just add a counter which grows at each list production and prepend it to the list then add the list to the [textfile]
In case b. I would probably save the lists unordered with [textfile] and then use some scripting like python to easily sort them

Lorenzo.
>
> 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


_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list