home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / awk / awk320.zip / TABLE.AWK < prev    next >
Text File  |  1990-02-08  |  401b  |  15 lines

  1. # form1 - format countries data by continent, pop. den.
  2.  
  3. # AKW p91
  4.  
  5. BEGIN { FS = "\t"   # make tab the field separator
  6.         printf("%10s %6s %5s   %s\n\n",
  7.               "COUNTRY", "AREA", "POP", "CONTINENT")
  8.       }
  9.       { printf("%10s %6d %5d   %s\n", $1, $2, $3, $4)
  10.         area = area +$2
  11.         pop = pop + $3
  12.       }
  13. END   { printf("\n%10s %6d %5d\n", "TOTAL", area, pop) }
  14.  
  15.