CCL: Sorting Question



I certainly do not want to defend Windows!

 

>Peter Pinski [peter.pinski-forum=-=web.de] Hello,

> 

>excuse me, if I am wrong. but I have tried the sort function and it seemed that it sorts in an >ALPHANUMERICAL order and not in a numerical, i.e. 889<991 but 1021<991 !!! because 1<9.

 

Peter is correct, the DOS sort does use alphanumerical order, which is kind of stupid, but not a serious problem provided that the data is in the appropriate format.

 

INPUT FILE: test.txt

first      123.456

second     987.654

third     1234.56

fourth       9.87654

 

sort test.txt /+11 /O testsort.txt

 

OUTPUT FILE: testsort.txt

fourth       9.87654

first      123.456

second     987.654

third     1234.56

 

In other words, the data has to be decimal aligned and you need to tell the sort where the beginning of the numeric field is.  This however, will encounter some problems with scientific notation unless it is expressed carefully.

 

So, in conclusion, perhaps there are drawbacks to the Windows solution and it may indeed be worthwhile downloading, installing and learning a new command environment – but let’s not forget that simple is usually better than complex for the end user.

 

Dr. Philip G. Hultin

Associate Professor of Chemistry,

University of Manitoba

Winnipeg, MB

R3T 2N2

hultin-,-cc.umanitoba.ca

http://umanitoba.ca/chemistry/people/hultin