$ echo "1300018 a1 1300019 a1 1300100 a2 1300101 a2 1300126 a2 1300127 a2 1300128 a2 1300129 a2 1300130 a3 1300131 a3 1300132 a3 1300133 a3" | perl -lane' push @order, $F[ 1 ] unless $h{ $F[ 1 ] }; push @{ $h{ $F[ 1 ] } }, "$F[ 0 ]\n" }{ print "$_ " . @{ $h{ $_ } } . "file\n", @{ $h{ $_ } } for @order ' a1 2file 1300018 1300019 a2 6file 1300100 1300101 1300126 1300127 1300128 1300129 a3 4file 1300130 1300131 1300132 1300133
In reply to Re: question about algorithm
by jwkrahn
in thread question about algorithm
by cxfcxf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |