title: How to concatenate two files with an indentifer in a loop?
body: <p>I have 200 files: <code>cool1.txt,cool2.txt,..., cool100.txt and warm1.txt, warm2.txt,...,warm100.txt.</code></p>
  
  <p>All files have 2 columns of data. </p>
  
  <p>I would like to concatenate 200 files as follows to have <code>coolwarm1.txt ,coolwarm2.txt,coolwarm100.txt</code></p>
  
  <pre><code>cat cool1.txt warm1.txt &gt; coolwarm1.txt
  cat cool2.txt warm2.txt &gt; coolwarm2.txt
  ...
  cat cool100.txt warm100.txt &gt; coolwarm100.txt
  </code></pre>
  
  <p>Within each file of coolwarm*.txt, I like to add an identifier "cool" and "warm" after concatenating.</p>
  
  <p>So for example, coolwarm1.txt would look like this </p>
  
  <pre><code>Input 
      cool1.txt 
  
      S44298 33307
      S46800 32286
      S55145 29361
  
      warm1.txt
      S10253 27473
      S24395 33093
  
  Desired output for coolwarm1.txt
  
  S44298 33307 cool
  S46800 32286 cool
  S55145 29361 cool
  S10253 27473 warm
  S24395 33093 warm
  </code></pre>
  
  <p><code>awk '{print FILENAME, $0}' cool1.txt warm1.txt &gt; coolwarm1.txt</code> would give 
       close to what I want, but I could not manage further.</p>
  
  <p>Thank you very much for your help.</p>