awk/testdir/t.nameval

8 lines
132 B
Plaintext
Raw Normal View History

2019-06-23 05:13:57 -04:00
{ if (amount[$2] == "")
name[++n] = $2
amount[$2] += $1
}
END { for (i = 1; i <= n; i++)
print name[i], amount[name[i]]
}