title: Awk - check that a field can be converted to an integer
body: <p>Only print field if it can be converted to an integer</p>
  
  <p>If I have this sample text file</p>
  
  <pre><code>1 cat
  2 dog
  3 7
  4 fish5
  5 22
  </code></pre>
  
  <p>I want my awk script to only print the field if it can be converted to an integer.</p>
  
  <p>I don't want rows 1,2 and 4 to be printed.</p>
  
  <p>example awk script</p>
  
  <pre><code>BEGIN {
     print "testing conversion to integer on " ARGV[1];
     myinteger = 0;  # my atmept to force this var to an integer
  }
   myinteger = $2;
   myinteger != 0 { print $2; }
  </code></pre>
  
  <p>This doesn't work.</p>
  
  <p>How can I get this to work?</p>