I\'m using grep to match string in a file. Here is an example file:
example one, example two null, example three, example four null,
grep
Or use awk instead:
awk
awk '/null/ { counter++; printf("%s%s%i\n",$0, " - Line number: ", NR)} END {print "Total null count: " counter}' file