[PD] store and manipulate multiple lists
Lorenzo Sutton
lorenzofsutton at gmail.com
Thu Mar 15 13:41:07 CET 2012
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 at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
More information about the Pd-list
mailing list