I\'m learning awk from The AWK Programming Language and I have a problem with one of the examples.
If I wanted to print $3 if $2 is equal to a value (e.g.1
My awk version is 3.1.5.
Yes, the input file is space separated, no tabs.
According to arutaku's answer, here's what I tried that worked:
awk '$8 ~ "ClNonZ"{ print $3; }' test
0.180467091
0.010615711
0.492569002
$ awk '$8 ~ "ClNonZ" { print $3}' test
0.180467091
0.010615711
0.492569002
What didn't work(I don't know why and maybe due to my awk version:),
$awk '$8 ~ "^ClNonZ$"{ print $3; }' test
$awk '$8 == "ClNonZ" { print $3 }' test
Thank you all for your answers, comments and help!