BEGIN { FS = "," SUBSEP = " " CONVFMT = "%2.1f" NumRuns = 50 } { split($NF,Plans," ") for(key in Plans) { arr[$1,Plans[key]]++ } Returned[$1]++ } END { for (key in arr) { split(key,tmp,SUBSEP) projdata=tmp[1] # if(arr[key]/Returned[projdata] * 100 > 50) sorted[++I] = key" "arr[key]/Returned[projdata]*100 } asort(sorted) for (i = 1; i <= I; i++) print sorted[i] # print "" # print "How often did a project return a query?" # for (key in Returned) { # print key": "Returned[key]/NumRuns * 100"%" # } }