title: How to combine fields from two TXT files in awk
body: <p>I have two text files with content like this:</p>
  
  <p><strong>sum.txt</strong></p>
  
  <pre><code>|Name       |Sum |
  
  |User A     |100.0 |
  
  |User B     |40.0 |
  </code></pre>
  
  <p><strong>per_proj.txt</strong></p>
  
  <pre><code>|Name   |Project   |Hours |
  
  |User A |Project 1 |50.0 |
  
  |User A |Project 2 |30.0 |
  
  |User A |Project 3 |20.0 |
  
  |User B |Project 1 |20.0 |
  
  |User B |Project 2 |20.0 |
  </code></pre>
  
  <p>What I'd like to achieve is to merge these two files and get output like this:</p>
  
  <pre><code>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |Sum   | Project 1 | Project 2| Project 3|
  
  |User A     |100.0 |50.0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |30.0     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |20.0 |
  
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| Project 1 | Project 2| 
  
  |User B     |100.0 |20.0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;      |20.0   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   |
  </code></pre>
  
  <p>Can someone please share his/her knowledge on this one?</p>
  
  <p>I was exercising with awk snippets that I found here (starting with <a href="https://stackoverflow.com/questions/5467690/how-to-merge-two-files-using-awk">How to merge two files using AWK?</a>), but with no success :(</p>