|
|
1.1 root 1: structure Table = StringTable(type elem = int val default = 0);
2:
3: val table = Table.new();
4:
5: fun step (fields: string list) =
6: let val name::value::_ = fields
7: in Table.set table (name, Table.get table name + Awk.makeInt value)
8: end
9:
10: fun final () =
11: Table.app table (fn (s,n) => (print s; print "\t"; print n; print "\n";()))
12:
13: (* invoke by
14:
15: Awk.awk(stream,step,final)
16:
17: *)
18:
19:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.