Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Sorting with perl

by I0 (Priest)
on Aug 13, 2002 at 07:35 UTC ( [id://189721]=note: print w/replies, xml ) Need Help??


in reply to Sorting with perl

open F1,"<1st.file" or die "can't open 1st.file: $!"; chomp(my @order = <F1>); close F1; my $c = 'a'x (1+(log @order)/3); my %order = map {$_ => ++$c} @order; open F2,"<2nd.file" or die "can't open 2nd.file: $!"; print map{/\|(.*)/s} sort map{$order{(/([^|]*)/)[0]}."|$_"} <F2>; close F2;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found