Reputation: 2100
Why does awk not able to print the variable from a condition?
cat CRND0103-2013-WY_Sundance_8_NNW.txt | awk '{ ($7 == '-9999.0') ? a = 'true' : a = 'false'; print $7, a }'
or even awk '{b = 'true'; print b}'
does not work. Can anyone tell why this is the case?
Upvotes: 0
Views: 615
Reputation: 5533
You should replace '
to "
in your statement.
awk '{b = "true"; print b;}'
^ ^
Upvotes: 1