Quote:
Originally Posted by radoulov
Another one
(use nawk or /usr/xpg4/bin/awk on Solaris):
Code:
awk -F'[: ]' 'END {
fmt = "%-20s\t%s\t%s\n"
printf fmt, "Page:", "Hits", "Unique Hits"
for (p in h)
printf fmt, p, h[p], u[p]
}
!_[$1,$2]++ { u[$1]++ }
{ h[$1]++ }' file
|
That's neat and terse! Exactly the way I like it! I should have thought to use a regex as FS.
