How to delete the rows that start with "C" with awk?

awk, shell

Solution

If data is in file `data.txt`, then

With `awk`:

awk '!/^C/' data.txt

With `grep`:

grep -v ^C data.txt 

Display all lines without "C" at the start.

`^C` means to match letter "C" at start of line. `!` in awk, and `-v` in grep negate the match.

Problem

How can I delete the rows that start with "C" from a text file using `awk`? Any suggestions please.

Original source