2007-05-02 01:07:00 +00:00
|
|
|
BEGIN { FS = "\t"; }
|
|
|
|
{ pop[$4] += $3; }
|
2007-05-24 15:56:00 +00:00
|
|
|
END {
|
|
|
|
for (c in pop)
|
2007-05-02 01:07:00 +00:00
|
|
|
printf ("%15s\t%6d\n", c, pop[c]) | "sort -t'\t' +1rn";
|
2007-05-24 15:56:00 +00:00
|
|
|
|
|
|
|
# the following two statements make the program behave
|
|
|
|
# consistently across different platforms.
|
|
|
|
# on some platforms, the sort command output has
|
|
|
|
# been delayed until the program exits.
|
|
|
|
close ("sort -t'\t' +1rn");
|
|
|
|
sleep (1);
|
|
|
|
}
|