title: Using awk how do I combine data in two files and substitute values from the second file to the first file?
body: <p>Any ideas how to the following using awk?</p>
  
  <p>Two input files, data.txt and keys.txt:</p>
  
  <p>data.txt contains some data:</p>
  
  <pre><code>A;1
  B;2
  A;3
  </code></pre>
  
  <p>keys.txt contains "key;value" pairs ("C" is in this example not part of data.txt, but the awk script should still work):</p>
  
  <pre><code>A;30
  B;20
  C;10
  </code></pre>
  
  <p>The output should be as follows: </p>
  
  <pre><code>A;1;30
  B;2;20
  A;3;30
  </code></pre>
  
  <p>Hence, each row in data.txt that contains any key from keys.txt should get the corresponding value appended to the row in data.txt.</p>