#!/usr/bin/perl use strict; my %record; while (<DATA>) { my ($key, $val) = split /\s+/; push( @{ $record{$val} }, $key ); } for my $i ( sort keys %record ) { print "\n\n$i " . scalar @{ $record{$i} } . "file\n" . join "\n", @{ $record{$i} }; } __DATA__ 1300018 a1 1300019 a1 1300100 a2 1300101 a2 1300126 a2 1300127 a2 1300128 a2 1300129 a2 1300130 a3 1300131 a3 1300132 a3 1300133 a3
In reply to Re: question about algorithm
by bichonfrise74
in thread question about algorithm
by cxfcxf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |