My file looks like:
L 0 256 * * * * *
H 0 307 100.0 + 0 0
S 30 351 * * * * *
D 8 27 * * * * 99.3
C 11 1 * * * * *
for my script I would like to start by awk print $0 for certain lines using $1
Such as
awk '{if ($1!="C") {print $0} else if ($1!="D") {print $0}}'
But, there has to be a way to combine "C" and "D" into one IF statement… right?
For example if I want to search for == L,H,S ie… NOT C or D how would I right this?
Your present condition is not correct as both
$1!="C"and$1!="D"can’t be false at the same time. Hence, it will always print the whole file.This will do as you described: