title: If two columns from different files equal, replace third column with awk
body: <p>I am looking for a way to replace a column in a file, if two <code>ID</code> columns match.
  I have file <code>A.txt</code></p>
  
  <pre><code>c   a   b   ID
  1  0.01 5   1
  2  0.1  6   2
  3       2   3
  </code></pre>
  
  <p>and file <code>B.txt</code></p>
  
  <pre><code>ID   a   b
  1   10   15
  2   20   16
  3   30   12
  4   40   14
  </code></pre>
  
  <p>The output im looking for is
  file <code>A.txt</code></p>
  
  <pre><code>ID a    b   
  1  0.01 5   
  2  0.1  6   
  3   30  2   
  </code></pre>
  
  <p>I can find with awk which <code>ID</code> columns from both files match</p>
  
  <pre><code>awk 'NR==FNR{a[$1];next}$1 in a' B.txt A.txt
  </code></pre>
  
  <p>But how to add replacement. Thank you for any suggestions.</p>