From owner-chemistry@ccl.net Tue May 2 19:42:00 2006 From: "Phil Hultin hultin*|*cc.umanitoba.ca" To: CCL Subject: CCL: Sorting Question Message-Id: <-31668-060502151254-2669-mv3ZBuBP7WDoYcWrkCQ2MA-#-server.ccl.net> X-Original-From: "Phil Hultin" Content-Type: multipart/alternative; boundary="----=_NextPart_000_0014_01C66DF2.7D1D8E40" Date: Tue, 2 May 2006 14:12:41 -0500 MIME-Version: 1.0 Sent to CCL by: "Phil Hultin" [hultin__cc.umanitoba.ca] This is a multi-part message in MIME format. ------=_NextPart_000_0014_01C66DF2.7D1D8E40 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0014_01C66DF2.7D1D8E40 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I certainly do not want to defend = Windows!

 

>Peter Pinski [peter.pinski-forum=3D-=3Dweb.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

 

------=_NextPart_000_0014_01C66DF2.7D1D8E40--