Using awk, you can provide rules for specific patterns with syntax
awk 'pattern {action}' file
see the awk manual page for a template definition. In your case, you can use regex as a template with syntax
awk'/regular expression/ {action}' file
and a basic regex that would suit your needs could be
awk '/^[^CD]/ {print $0}' file
which you can really shorten in
awk '/^[^CD]/' file
since {print $0} is the default action as suggested in the comments.
Vincent nivoliers
source share