[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: svn list - sorting (natural sort)

From: Gregory Smith <greg_at_siliconoptix.com>
Date: 2005-02-07 16:01:36 CET

At http://sourceforge.net/projects/numacomp

.. there is a 'numacomp' (numerically aware compare), which is in the
form of a python extension in C.

Unlike many other solutions, this one is formally well behaved:

 

- works on strings with multiple numeric subfields

- strings never compare equal unless they are identical

- transitive and commutative (i.e. A < B and B < C => A<C,
and A < B => B > A)

 

The last one is important, since without these properties, you can get
in trouble using the compare

in a sort.

 

 

 

  _____

From: Ryan Schmidt [mailto:subversion-2004@ryandesign.com]
Sent: Sunday, February 06, 2005 5:52 PM
To: Hakan Koseoglu
Cc: Subversion List
Subject: Re: svn list - sorting (natural sort)

 

On 06.02.2005, at 23:44, Hakan Koseoglu wrote:

 

Instead of the desired naturally-sorted output:

module/v_1

module/v_3

module/v_20

module/v_112

 

GNU sort has -n option to sort numerically. Would that help?

 

Not that I can see, because as the man page says, it only sorts on an
initial numeric string, not a numeric string later in the line.

 

---------------------------------------------------------------------------------
This e-mail and any attachments may contain confidential information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any use, review, dissemination, forwarding, printing or copying of this email or any information or attachments contained herein by a person other than the intended recipient is unauthorized and may be illegal. Silicon Optix reserves the right to monitor all e-mail communications through its networks for quality control purposes.
Received on Mon Feb 7 16:05:44 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.