NF != 3 { shape++; next } $3 !~ /^[0-9]+$/ { numeric++; next } { accepted++; total += $3; print "data", $1, $2, $3 } END { print "accepted", accepted + 0, "total", total + 0 print "bad_shape", shape + 0, "bad_number", numeric + 0 }