in reply to Repeats exclusion
perl -T my %hash;while(<DATA>){ my($cord,$dist)=split; push @{$hash{$cord}},$dist;} print join "\n",map { $_."\t\t".(sort {$a <=> $b} @{$hash{$_}})[0] } sort {$a <=> $b}keys %hash __DATA__ 567 344 1345 567 2346 78 3456 67 3456 789 4678 45 5349 6 6700 124 6700 50 8964 560 567 344 1345 567 2346 78 3456 67 4678 45 5349 6 6700 50 8964 560
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Repeats exclusion
by Grig (Novice) on Sep 12, 2010 at 16:07 UTC | |
by JavaFan (Canon) on Sep 13, 2010 at 14:12 UTC | |
by suhailck (Friar) on Sep 14, 2010 at 05:52 UTC |