PROBLEMI want to specifically use AWK (GAWK, MAWK, whatever) in an AWK script to sum up the values in field 9 for every record that contains runner__.jpx (the underscores are placeholders for two digits 0-9) in field 6 and good in FIELD 7.SAMPLE FILEFeb 14 11:33:16 ringer a[2388]: runner01.jpx good aa 3Feb 14 11:33:32 ringer a[2388]: runner24.jpx good xx 1Feb 14 11:33:39 ringer a[1894]: jogger02.jpx good aa 5Feb 14 11:33:45 ringer a[2388]: runner99.jpx stop cc 1ATTEMPTHow could I do this?  I tried using an if statement, like:BEGIN {    sum = 0}{    if (($6 == runner[0-9][0-9].jpx) && ($7 == good))        sum += $9}END {        printf sum}Is there way to do this by matching strings in fields using if statements?  Am I allowed to use regular expressions within the if statement?  What is an alternative method to do this?  Thanks.
Regular Expressions within a string in AWK using if/then control structure?
shell script;scripting;awk;mawk
The following should do the job. Note that you do not need explicit ifs, just use awk's implicit pattern-action modelawk  '$6 ~ /^runner[0-9][0-9]\.jpx$/ && $7 == good {s += $9};      END{print s}' input.file