title: Combining multiple tables/files by mapping to a common column - awk,sed
body: <p><strong>This is an edited post (<a href="https://stackoverflow.com/questions/67191698/awk-sed-method-to-combine-multiple-files-to-one-by-mapping-to-a-common-file-colu">awk,sed method to combine multiple files to one by mapping to a common file/column</a>)</strong></p>
  <p><strong>Due to my naivety the last post was not in the correct format and was closed down before getting a correct answer. For some unknown reason, I could not edit/delete the said post.</strong></p>
  <p>Sorry for the trouble. Hope this is the correct format.</p>
  <p>I have 11 (tab-separated) files each with two columns as shown below. the row number varies with some files having 1000 rows while some above 2500.</p>
  <p><strong>File-0</strong></p>
  <p>This is the mapping file</p>
  <pre><code>K00001 0
  K00002 0
  K00003 0
  K00004 0
  K00005 0
  </code></pre>
  <p>This file goes up to <strong>K30000   0</strong> covering all <strong>K</strong>numbers in the rest of the file</p>
  <p><strong>File-1</strong></p>
  <pre><code>K00002 0.60
  K00003 31
  K00006 0.21
  K00007 0.06
  K00012 0.01
  </code></pre>
  <p><strong>File-2</strong></p>
  <pre><code>K00003 21
  K00004 0.54
  K00005 0.4
  K00006 0.01
  K00009 0.39
  K00010 0.01
  </code></pre>
  <p><strong>File-3</strong></p>
  <pre><code>K00002 09
  K00003 0.11
  K00004 0.87
  K00006 0.54
  K00007 0.11
  K00008 0.02
  </code></pre>
  <p>I want to combine all these 10 files (file-1....file-10) into one by mapping to the first column of file-0. The output I would like will be like this:</p>
  <pre><code>K00001
  K00002 0.60         9
  K00003 31 21        0.11
  K00004       0.54   0.87
  K00005       0.4    
  K00006 0.21  0.01   0.54
  K00007 0.06         0.11
  K00008              0.02
  K00009       0.39   
  K000010      0.01   
  K000011         
  K00012 0.01     
  </code></pre>
  <p>Can anyone help me with this?</p>
  <p>Thanks.</p>