BEGIN { myformat="%-15s %3s %16s %11s %12s %12s\n" printf myformat, "Country", "TLD", "Area in sq. km", \ "Population", "Land lines", "Cell phones" printf myformat, "-------", "---", "--------------", \ "----------", "----------", "-----------" } { printf myformat, $1, $2, $3, $4, $5, $6 areatot += $3 poptot += $4 landtot += $5 celltot += $6 } END { printf myformat, "\nTotals:", NR, areatot, poptot, landtot, celltot "\n" }