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

Re: Sorting By Column

by oiskuu (Hermit)
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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-02-13 01:36 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (415 votes), past polls