chiark / gitweb /
debugging for thing that crashed
[innduct.git] / contrib / count_overview.pl
1 #!/usr/local/bin/perl
2 #
3 # count_overview.pl:  Count the groups in a bunch of xref records.
4
5 while (<>) {
6
7 chop;
8 @xreflist = split(/\t/); # split apart record
9
10 $_ = $xreflist[$#xreflist];  # xref is last.
11
12 @xreflist = reverse(split(/ /));  #break part xref line.
13
14 pop @xreflist;  # get rid xref header
15 pop @xreflist;
16
17 while ($current = pop @xreflist) {
18         ($current) = split(/:/,$current);  #get newsgroup name
19         $groups{$current}++;  #tally
20 }
21
22 }
23
24 # display accumulated groups and counts.
25 foreach $current (sort keys %groups) {
26         printf "%-50s\t%5d\n", $current, $groups{$current};
27 }