qse/regress/awk/cou-026.awk

35 lines
370 B
Awk
Raw Normal View History

BEGIN { FS = "\t"; }
2009-07-01 07:14:39 +00:00
{ pop[$4] += $3; }
2009-07-01 07:14:39 +00:00
END {
count = 0;
for (name in pop)
{
for (i = 0; i < count; i++)
{
if (name < x[i])
{
for (j = count; j > i; j--)
{
x[j] = x[j-1];
y[j] = y[j-1];
}
break;
}
}
x[i] = name;
y[i] = pop[name];
count++;
}
for (i = 0; i < count; i++)
{
print x[i], y[i];
}
}