unpack for text?

haarbol's icon

Hi,

I'm making a patch which fetches some info from an external text-file with several colums, a simple example would be:

01 text1

The complete line is imported in max and unpacked.

However, if i route this through unpack (unpack 1 2) i get "01" and "0" - is there a way to actually output this second argument as the original text?

Emmanuel Jourdan's icon

On 25 mars 07, at 22:49, Lucas wrote:

> However, if i route this through unpack (unpack 1 2) i get "01" and
> "0" - is there a way to actually output this second argument as the
> original text?

You tried [unpack 1 s] or something similar, didn't you?

ej

_j's icon

i'm not sure why you would get "01", unpacking an int would return 1, "01" is a symbol, not an integer.

Emmanuel Jourdan's icon
Stefan Tiedje's icon

Lucas schrieb:
> However, if i route this through unpack (unpack 1 2) i get "01" and
> "0" - is there a way to actually output this second argument as the
> original text?

Beside [unpack 0 s] you can also use [zl slice 1] if you have varying
types of list elements and don't want to change them...
If you want to unpack a lot of elements, have a look at my unpacker
abhaXion, its based on zl slices... (at cycling/share)

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com