Outputting the nth element of many lists as a new list?

Harromelt's icon

Hello -

I am wondering if there is a nice way to take in a large number of lists, and then output just the nth character of all of them as one list. A way to visualize what I mean would be to imagine a huge table of lists, and outputting vertical columns of that table as a list. Also important would be to output the data as soon as any new input comes in.

Thanks!

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

Harromelt's icon

Thanks, worked!

Harromelt's icon

also: had to message [sort -1 -1] to the coll to dump it in correct order.

metamax's icon

Thanks.. though the saved coll in the example is sorted by ascending index and outputs lists in the correct order for me. Not sure how [sort -1 -1] changes things. In any event, you might consider sending packed value pairs into a message object [nth $1 $2] directly to the coll. That allows for custom sequencing of any element at any index.

c. r.'s icon

hi metamax and harromelt,

may i follow up on this because i have a somewhat similar question but rather for beginners, i guess. i'd like to pick the nth element of a list (which, i know, i can do with the [zl nth]), but repeatedly so. so, if i had a list of

1 2 3 4 5 6 7 8 9

i'd like to pick every third number and only every third number of that list. the reason why your solution doesn't seem very handy is that in my case, i have no use for the [coll] object.

i'd appreciate a quick answer,
i guess, i'll be surprised how simple the solution turns out to be…

thanks & best!

Roman Thilenius's icon

uzi
* 3
zl nth

Rick's icon

I vote for zl.group 3 to zl.nth 3

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