#! /usr/bin/gawk -f # Last edited on 1999-11-25 05:08:35 by stolfi BEGIN { split("", nsc); split("", ns); split("", nc); n = 0; split("", str); nstr = 0; split("", ctx); nctx = 0; } /./ { count = $1; s = $2; c = $3; nsc[s,c] += count; if(! (s in ns)) { str[nstr] = s; nstr++; } ns[s] += count; if(! (c in nc)) { ctx[nctx] = c; nctx++; } nc[c] += count; n += count; } END { printf "%-20s %4s ", "CONTEXT", "TOT"; for (i=0; i