1*9a7741deSElliott HughesBEGIN { FS = ":" } 2*9a7741deSElliott Hughes{ 3*9a7741deSElliott Hughes if ($1 != prev) { 4*9a7741deSElliott Hughes if (prev) { 5*9a7741deSElliott Hughes printf "\t%-10s\t %6d\n", "total", subtotal 6*9a7741deSElliott Hughes subtotal = 0 7*9a7741deSElliott Hughes } 8*9a7741deSElliott Hughes print "\n" $1 ":" 9*9a7741deSElliott Hughes prev = $1 10*9a7741deSElliott Hughes } 11*9a7741deSElliott Hughes printf "\t%-10s %6d\n", $2, $3 12*9a7741deSElliott Hughes wtotal += $3 13*9a7741deSElliott Hughes subtotal += $3 14*9a7741deSElliott Hughes} 15*9a7741deSElliott HughesEND { printf "\t%-10s\t %6d\n", "total", subtotal 16*9a7741deSElliott Hughes printf "\n%-10s\t\t %6d\n", "World Total", wtotal } 17