$3 !~ /^[0-9]+$/ { print "invalid:", $1; next } { total += $3 } END { print "total", total + 0 }