BEGIN { for (i=1; i<=13; i++) x[i] = 0 total = 0 } { if ($2 != "*") x[$2]++ } END { printf "x[2] = 0: %d\n", x[0] printf "x[2] = 1: %d\n", x[1] }