Root/boom/count.pl

1#!/usr/bin/perl
2
3$tot = 0;
4while (<>) {
5    next unless /\bT=(.+?)\b/;
6    $tot++;
7    $c = $1;
8    $cat{$c}++;
9    /^\s*(\S+)\s/;
10    $man{$c}{$1}++;
11}
12
13print "Total: $tot\n";
14for $c (sort keys %cat) {
15    print " $c: $cat{$c}\n";
16    for $m (sort keys %{ $man{$c} }) {
17        print "\t$m: $man{$c}{$m}\n";
18    }
19}
20

Archive Download this file

Branches:
master



interactive