#! /bin/gawk -f { gensub(/\x00/, " ", "g"); # replace regexp with " " if ($0 ~ /^([:space:]|\r)+$/) { # ignore blank line print "Recognized a blank line \"", $0, "\""; } else { if ($0 ~ /^([:space:]|\r)*(Subject|Date|CC|BCC|From|To):/) { print "Recognized input \"", $0. "\""; getline; } else { print "Did not recognize input \"",$0, "\""; } } }