I have an awk command to print out the total number of times "200" occurred in column 26.
awk '$26 ~ /200/{n++}; END {print n+0}' testfile
How do I modify this statement so I can pass 200 as a variable? e.g. if I have a variable $code with a value of 200
Thanks in advance
codehas the value20and the number200appears in field 26, should that match or not? Are you looking for a match on the WHOLE of field 26 or only part of it?