You're viewing a comment by Peteris Krumins and its responses.

February 19, 2009, 09:34

Ed, easy:

$ awk '$3 ~ /pattern/ { print $1, $2, $3 } $3 !~ { print "na", "na", $3 }'

or

$ awk '$3 ~ /pattern/ { print $1, $2, $3; next } { print "na", "na", $3 }'

or

$ awk '{ if ($3 ~ /pattern/) { print $1, $2, $3 } else { print "na", "na", $3 } }'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.