2007-05-02 01:07:00 +00:00
|
|
|
BEGIN { FS = "\t"; }
|
2009-07-01 07:14:39 +00:00
|
|
|
|
2007-05-02 01:07:00 +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];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|