title: Concatenate multiple files and create new file based on the value
body: <p>I have more than 50 files as like this</p>
  <p>dell.txt</p>
  <pre><code>Name  Id  Year  Value
  xx.01 45  1990  2k
  SS.01 89  2000  6.0k
  </code></pre>
  <p>Hp.txt</p>
  <pre><code>Name  Id  Year  Value
  xx.01 48  1994  21k
  SS.01 80  2001  2k
  </code></pre>
  <p>Apple.txt</p>
  <pre><code>Name  Id  Year  Value
  xx.02 45  1990  20k
  SS.01 89  2000  60k
  kp.03 23  1996  530k
  </code></pre>
  <p>I just need to make a new file as like this</p>
  <pre><code>Name  Id  Year  dell  Hp  Apple 
  xx.01 45  1990  2k    0   0
  xx.01 48  1994  0     21k 0
  xx.02 45  1990  0     0   20k
  SS.01 80  2001  0     2k  0
  SS.01 89  2000  6.0k  0   60k
  kp.03 23  1996  0     0   530k
  </code></pre>
  <p>I tried with paste for concatenation but it is adding different order. any other way using awk? I used flowing code:</p>
  <pre><code>$ awk ' FNR==1{ if (!($0 in h)){file=h[$0]=i++} else{file=h[$0];next} } {print &gt;&gt; (file)} ' *.txt –
  </code></pre>