qse/ase/test/awk/cou-002.out

30 lines
703 B
Plaintext

BEGIN {
__global7 = " ";
printf ("%10s %6s %5s %s\n\n","COUNTRY","AREA","POP","CONTINENT");
}
{
printf ("%10s %6d %5d %s\n",$1,$2,$3,$4);
area = (area + $2);
pop = (pop + $3);
}
END {
printf ("\n%10s %6d %5d\n","TOTAL",area,pop);
}
COUNTRY AREA POP CONTINENT
USSR 8649 275 Asia
Canada 3852 25 North America
China 3705 1032 Asia
USA 3615 237 North America
Brazil 3286 134 South America
India 1267 746 Asia
Mexico 762 78 North America
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe
TOTAL 25681 2819