in reply to Re^2: Repeats exclusion
in thread Repeats exclusion

The code is modified for your new requirement

use strict; my %hash;while(<DATA>){ my($cord,@others)=split; push @{$hash{$cord}},\@others;} print map {my $__=$_; map {$__," @{$hash{$__}->[$_->[0]]}","\n"} (sort {$a->[1] <=> $b->[1]} map{[$_,${$hash{$_}}->[$_]->[0]]} 0 .. $#{$hash{$__}})[0]} sort {$a <=> $b}keys %hash __DATA__ 567 344 5 7 8 1345 567 5 8 123 2346 78 12 1 567 3456 67 10 1 5 3456 789 10 3 6 4678 45 6 2 0 5349 6 8 2 14 6700 124 13 8 56 6700 50 13 1 4 8964 560 2 18 8