Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: sorting by numbers then alphabetically

by Anonymous Monk
on Dec 23, 2010 at 17:32 UTC ( [id://878844]=note: print w/replies, xml ) Need Help??


in reply to Re: sorting by numbers then alphabetically
in thread sorting by numbers then alphabetically

I was just looking at that but it doesn't do what i want does it...it sorts by letters then numbers doesnt it?
  • Comment on Re^2: sorting by numbers then alphabetically

Replies are listed 'Best First'.
Re^3: sorting by numbers then alphabetically
by eff_i_g (Curate) on Dec 23, 2010 at 19:44 UTC
    Per the docs:
    Under natural sorting, strings are splitted at word and number boundaries, and the resulting substrings are compared as follows:

    * numeric substrings are compared numerically
    * alphabetic substrings are compared lexically
    * numeric substrings come always before alphabetic substrings
Re^3: sorting by numbers then alphabetically
by Marshall (Canon) on Dec 23, 2010 at 19:56 UTC
    I came back and looked at this thing. Looks like it would do close to what you want. From your problem description, my understanding is that you have just either numeric or alphabetic strings - so doesn't appear that there would be any substring splitting. However the "non-module" sort function as I show below is easy to write and also incorporates the case insensitive feature.
    Under natural sorting, strings are splitted at word and number boundaries, and the resulting substrings are compared as follows: * numeric substrings are compared numerically * alphabetic substrings are compared lexically * numeric substrings come always before alphabetic substrings

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://878844]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found