gno/usr.bin/awk/tests/ch2p54.awk

8 lines
197 B
Awk
Raw Normal View History

# print continents and populations, sorted by population
BEGIN { FS = "\t" }
{ pop[$4] += $3 }
END { for (c in pop)
printf("%15s\t%6d\n", c, pop[c]) | "sort -t'\t' +1rn"
}