hi,
not quite. I should have been more explicit. The list would initially
look more like this
["a 1", "a 10", "a 100", "a 11", "a 12", "a 2", "a 21"]
The question then is after an alphanumeric sort, which is what
mylist.sort() does, i want to do a numeric sort to return :
["a 1", "a 2","a 10", "a 11", "a 12", "a 21","a 100"]
The reason I'm after an algorithm is that the integers may exist
anywhere within the string.
julian
hi,
Does anyone know of a decent algorithm for sorting director lists
numerically?
e.g. for a directory alphabetically sorted with no leading zeros.
a 1
a 10
a 100
a 11
a 12
a 2
a 21
would become
a 1
a 2
a 11
a 12
a 21
a 100
I can't believe I've never come up against this before :/
Julian
[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi To post messages to the list,
email [email protected] (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
Mark Hagers
[EMAIL PROTECTED]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list,
email [email protected] (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]