Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: schwartzian transform

by GrandFather (Saint)
on Oct 13, 2014 at 21:16 UTC ( #1103675=note: print w/replies, xml ) Need Help??


in reply to schwartzian transform

Neither your sample nor your description make it clear how you want the data sorted. However the following may help you sort out whatever it it you want to do:

use strict; use warnings; my @array = map {$_->[0]} sort {$b->[5] <=> $a->[5] || $b->[3] <=> $a->[3]} map {[$_, /(\d+),(\D+)(\d+)(\D+)(\d+)/]} map {chomp; s/'//g; $_} <DATA>; print join "\n", @array; __DATA__ 31 '0,wupra00a0535' 147 '0,wuprm00a0539' 148 '0,wuprm00a0539' 149 '28,wppra02a0015' 150 '24,wppra01a0016' 151 '0,wupra00a0532' 152 '15,wppra01a0015'

Prints:

147 0,wuprm00a0539 148 0,wuprm00a0539 31 0,wupra00a0535 151 0,wupra00a0532 150 24,wppra01a0016 149 28,wppra02a0015 152 15,wppra01a0015
Perl is the programming world's equivalent of English

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2023-03-21 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?