alphabetical/numerical sorting...

MIB's icon

This is probably very basic, and I do appologize, but I am not sure how to handle this.
I have a coll with a bunch of (in this case) pictures in it and would like to arrange them numerically from Pic0.jpeg to Pic33.jpeg. "sort -1 1" doesn't do what I want it to. What am I missing???
The pics are nicely order in my folder on my desktop but as soon as I read it with the "folder" object, things get scrambled...
Any ideas???

Thanks a bunch.

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

jml's icon

There are two issues:
1. You should be using leading zeros with your incremented pic-names, and be consistent; for ex: pic00.jpg, pic01.jpg, etc. Otherwise (as is the case with OS interpretation), the names get interpreted "out of sequence" when read in.
2. To sort, you can use sort -1 (data in ascending order) followed by "renumber", so:
(messagebox) [sort -1, renumber]
should do the trick for you.

jl

Stefan Tiedje's icon

Martin Ritter schrieb:
> This is probably very basic, and I do appologize, but I am not sure
> how to handle this. I have a coll with a bunch of (in this case)
> pictures in it and would like to arrange them numerically from
> Pic0.jpeg to Pic33.jpeg. "sort -1 1" doesn't do what I want it to.
> What am I missing??? The pics are nicely order in my folder on my
> desktop but as soon as I read it with the "folder" object, things get
> scrambled... Any ideas???

They are sorted, but alphabetical and not numerical. If you want it
numerical you have to extract the numbers, dump it into a coll, sort it
and then fill the menu...

The suggestion of jl is easier, just name them alphabetically....

Stefan

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

Emmanuel Jourdan's icon

On 3 juin 07, at 02:42, Martin Ritter wrote:

> This is probably very basic, and I do appologize, but I am not sure
> how to handle this.
> I have a coll with a bunch of (in this case) pictures in it and
> would like to arrange them numerically from Pic0.jpeg to
> Pic33.jpeg. "sort -1 1" doesn't do what I want it to. What am I
> missing???
> The pics are nicely order in my folder on my desktop but as soon as
> I read it with the "folder" object, things get scrambled...

You can extract the number with a simple regular expression. In that
case I'm just looking for a digit "\d" which appears at least once "+".

ej

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