[OS X TeX] Opening many files in order

Berend Hasselman bhh at xs4all.nl
Wed May 20 10:10:12 EDT 2009


On 20-05-2009, at 15:57, David Watson wrote:

> The way MacOSX sorts is by dictionary order, so you will see files  
> 1, 2, ..., 10 as:
>
> 1
> 10
> 2
> 3
> ...
>
> If you wanted them to open in numerical order, then you can achieve  
> that by naming them with sufficient leading zeroes to force the  
> dictionary order to match:
>
> 01
> 02
> ...
> 09
> 10
>
Isn't that with ls in Terminal?

I am running Mac OS X 10.5.7.

I did the following:   for i in 1 2 3 4 5 6 7 8 9 10 11;do touch $i;  
done

Finder sorts these (View options sorting by name) as  
1,2,3,4,5,6,7,8,9,10,11 (from top to bottom)

When I do:    for i in 1 2 3 4 5 6 7 8 9 10 11;do touch XXX$i; done
Finder sorts these as: XXX1, XXX2, etc.

When I do:  for i in 01 02 03 04 05 06 07 08 09 10 11;do touch ZZZ$i;  
done
the results are similar: ZZZ01, ZZZ02, etc

According to this document: http://support.apple.com/kb/TA22935?viewlocale=en_US
the Finder will treat whole numbers numerically.

So I guess that at least on my system the sort order is what Alain  
wants.

Berend





More information about the MacOSX-TeX mailing list