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

Re: Sorting By Column

by oiskuu (Pilgrim)
on Jul 10, 2014 at 22:04 UTC ( #1093138=note: print w/ replies, xml ) Need Help??


in reply to Sorting By Column

If file identity in column 1 were omitted, you could use the unix comm utility to eliminate duplicates.

See if this works to your satisfaction (give input files as arguments):

#! /usr/bin/perl my %X; for (<>) { my ($i,$k,$n) = split(" ",$_,3); $X{$k.$n}{$k.$i} = $_; } for (sort {$a->[0] cmp $b->[0]} map [%$_], values %X) { print $_->[1] if @$_ == 2; }


Comment on Re: Sorting By Column
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1093138]
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: (8)
As of 2014-09-16 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (53 votes), past polls