title: using awk with column value conditions
body: <p>I'm learning awk from <a href="https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoIC7/The_AWK_Programming_Language.pdf" rel="noreferrer">The AWK Programming Language</a> and I have a problem with one of the examples.</p>
  
  <p>If I wanted to print $3 if $2 is equal to a value (e.g.<code>1</code>), I was using this command which works fine:</p>
  
  <pre><code>awk '$2==1 {print $3}' &lt;infile&gt; | more
  </code></pre>
  
  <p>But when I substitute 1 by another searching criteria, (e.g.<code>findtext</code>), the command doesn't work:</p>
  
  <pre><code>awk '$1== findtext {print $3}' &lt;infile&gt; | more
  </code></pre>
  
  <p>It returns no output and I'm sure that 'findtext' exist on the input file.</p>
  
  <p>I also tried this, but it does not work:</p>
  
  <pre><code>awk '$1== "findtext" {print $3}' &lt;infile&gt; | more
  </code></pre>
  
  <p>Here's my test file named 'test' and it has 9 lines and 8 fields, separated by space:</p>
  
  <pre><code>1 11 0.959660297 0 0.021231423 -0.0073 -0.0031 MhZisp
  2 14 0.180467091 0.800424628 0 0.0566 0.0103 ClNonZ
  3 19 0.98089172 0 0 -0.0158 0.0124 MhNonZ
  4 15 0.704883227 0.265392781 0.010615711 -0.0087 -0.0092 MhZisp
  5 22 0.010615711 0.959660297 0.010615711 0.0476 0.0061 ClNonZ
  6 23 0.715498938 0 0.265392781 -0.0013 -0.0309 Unkn
  7 26 0.927813163 0 0.053078556 -0.0051 -0.0636 MhZisp
  8 44 0.55626327 0.222929936 0.201698514 0.0053 -0.0438 MhZisp
  9 31 0.492569002 0.350318471 0.138004246 0.0485 0.0088 ClNonZ
  </code></pre>
  
  <p>Here's what I did and the output:</p>
  
  <pre><code>$awk '$8 == "ClNonZ" {print $3}' test 
  
  $ grep ClNonZ test 
  2 14 0.180467091 0.800424628 0 0.0566 0.0103 ClNonZ
  5 22 0.010615711 0.959660297 0.010615711 0.0476 0.0061 ClNonZ
  9 31 0.492569002 0.350318471 0.138004246 0.0485 0.0088 ClNonZ
  </code></pre>
  
  <p>I expect to see this which is the $3 that has "ClNonZ" in their $8.</p>
  
  <pre><code>0.180467091 
  0.010615711 
  0.492569002
  </code></pre>
  
  <p>Don't know why the awk command didn't return anything. Any thoughts?</p>