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]++ }' HITS |
( IFS='' read header; echo "$header"; sort -k2rn )
The
read takes one line off and prints it, leaving the rest as input to
sort.