#!/usr/bin/perl my %t; while ( defined($_ = <DATA>) ){ chomp; my ($k, $v) = split /\s+/; push @{$t{$k}}, $v; } for ( sort keys %t ) { my %q; @q{@{$t{$_}}} = (); print "$_ ", join( ' ', sort keys %q), "\n"; } __DATA__ 1 101 2 102 3 103 1 104 2 102 3 104
In reply to Re: Removing duplicates
by borisz
in thread Removing duplicates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |