File: count_overview.pl

package info (click to toggle)
inn2 2.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,720 kB
  • ctags: 8,983
  • sloc: ansic: 92,499; sh: 13,509; perl: 12,921; makefile: 2,985; yacc: 842; python: 342; lex: 255
file content (27 lines) | stat: -rwxr-xr-x 579 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/local/bin/perl
#
# count_overview.pl:  Count the groups in a bunch of xref records.

while (<>) {

chop;
@xreflist = split(/\t/); # split apart record

$_ = $xreflist[$#xreflist];  # xref is last.

@xreflist = reverse(split(/ /));  #break part xref line.

pop @xreflist;  # get rid xref header
pop @xreflist;

while ($current = pop @xreflist) {
	($current) = split(/:/,$current);  #get newsgroup name
	$groups{$current}++;  #tally
}

}

# display accumulated groups and counts.
foreach $current (sort keys %groups) {
	printf "%-50s\t%5d\n", $current, $groups{$current};
}