aboutsummaryrefslogtreecommitdiff
path: root/testdir/p.52
blob: f60acc1b4669acbc36db41735cc8b76950b4c439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
BEGIN	{ FS = ":" }
{
	if ($1 != prev) {
		if (prev) {
			printf "\t%-10s\t %6d\n", "total", subtotal
			subtotal = 0
		}
		print "\n" $1 ":"
		prev = $1
	}
	printf "\t%-10s %6d\n", $2, $3
	wtotal += $3
	subtotal += $3
}
END	{ printf "\t%-10s\t %6d\n", "total", subtotal
	  printf "\n%-10s\t\t %6d\n", "World Total", wtotal }