xref: /freebsd/contrib/one-true-awk/testdir/p.52 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1BEGIN	{ FS = ":" }
2{
3	if ($1 != prev) {
4		if (prev) {
5			printf "\t%-10s\t %6d\n", "total", subtotal
6			subtotal = 0
7		}
8		print "\n" $1 ":"
9		prev = $1
10	}
11	printf "\t%-10s %6d\n", $2, $3
12	wtotal += $3
13	subtotal += $3
14}
15END	{ printf "\t%-10s\t %6d\n", "total", subtotal
16	  printf "\n%-10s\t\t %6d\n", "World Total", wtotal }
17