#Input is ... #FILENAME,I,LEARNER,TIME,SUBSET,ESTIMATE,ACTUAL,MRE BEGIN { FS=OFS="," Pred=30 } { # need a count to divide by #if ($3="LC") {LC++}; LC=1; if ($NF<=Pred) { #Key=$1","$3 Key=$3 #print Key Counts[Key]++; } } END { learnerCount=0; for(key in Counts) { learnerCount++; } print learnerCount; print NR; for(key in Counts) { print key, Counts[key]; } }