diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-23 03:13:57 -0600 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-23 03:13:57 -0600 |
commit | d6c466c3671aeecf5e64b5bf9692f44517aefb46 (patch) | |
tree | 82cb4d461a702fac42d20e145fa846064c3d0cd6 /testdir/p.52 | |
parent | ae99b752af2f72bae5d4948f5b2e31dac0409601 (diff) | |
download | one-true-awk-d6c466c3671aeecf5e64b5bf9692f44517aefb46.tar.gz |
Extract testdir.
Diffstat (limited to 'testdir/p.52')
-rw-r--r-- | testdir/p.52 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testdir/p.52 b/testdir/p.52 new file mode 100644 index 0000000..f60acc1 --- /dev/null +++ b/testdir/p.52 @@ -0,0 +1,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 } |