Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sort on Number Embedded in String

by jdporter (Canon)
on Mar 23, 2005 at 17:21 UTC ( #441835=note: print w/replies, xml ) Need Help??


in reply to Sort on Number Embedded in String

I'm surprised no one has suggested the GRT yet. This is an ideal case for it.
my @a = <DATA>; chomp @a; @a = map { substr $_, 10 } sort map { sprintf "%10s%s", /(\d+\w{3}\d{4})/, $_ } @a; print join "\n", @a, ''; __DATA__ fwlog.14Mar2005.gz fwlog.15Mar2005.gz fwlog.16Mar2005.gz fwlog.17Mar2005.gz fwlog.18Mar2005.gz fwlog.19Mar2005.gz fwlog.1Mar2005.gz fwlog.20Mar2005.gz fwlog.21Mar2005.gz fwlog.2Mar2005.gz fwlog.3Mar2005.gz fwlog.4Mar2005.gz fwlog.5Mar2005.gz fwlog.6Mar2005.gz fwlog.7Mar2005.gz fwlog.8Mar2005.gz fwlog.9Mar2005.gz

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://441835]
help
Chatterbox?
[robby_dobby]: if I do make it, I can at least savour their local tea! :-)
[LanX]: oh they have sleper cells everywhere
[robby_dobby]: LanX: Not really, the only problems would be from religious divides. Coptics/Moslems/ Kurds/Jews
[erix]: Zzz
[erix]: Coptics? :)
[robby_dobby]: erix: Coptic Christians in Egypt
[choroba]: Robocoptic!
[erix]: I like Coptics :)
[LanX]: Copts
[erix]: sorry - just pulling your leg

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (17)
As of 2017-04-24 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.