title: Print values from both files using awk as vlookup
body: <p>I have two files, file1:</p>
  <pre><code>1 I0626_all 0 0 1 1 
  2 I0627_all 0 0 2 1 
  3 I1137_all_published 0 0 1 1 
  4 I1859_all 0 0 2 1 
  5 I2497_all 0 0 2 1 
  6 I2731_all 0 0 1 1 
  7 I4451_all 0 0 1 1 
  8 I0626 0 0 1 1 
  9 I0627 0 0 2 1 
  10 I0944 0 0 2 1 
  </code></pre>
  <p>and file 2:</p>
  <pre><code>I0626_all 1 138
  I0627_all 1 139
  I1137_all_published 1 364
  I4089 1 365
  AfontovaGora2.SG 1 377
  AfontovaGora3_d 1 378
  </code></pre>
  <p>At the end I want</p>
  <pre><code>1 I0626_all 138 
  2 I0627_all 139
  3 I1137_all_published 364
  </code></pre>
  <p>I tried using:</p>
  <pre><code>awk 'NR==FNR{a[$1]=$2;next} {b[$3]} {print $1,$2,b[$3]}' file2 file1
  </code></pre>
  <p>But It doesnt work.</p>