title: Redirect data from several files into one master file
body: <p>I have multiple data files and I want to redirect some information from these files to another master file. </p>
  
  <p>First I create the column headers in the master file. Then I attempt to transfer data from other files to the master file under the correct columns. </p>
  
  <h3>Create column headers in master file:</h3>
  
  <pre><code>awk '
  BEGIN {OFS="      "; print "%eval_id", "SF1", "power"}
  ' &gt; output.dat
  </code></pre>
  
  <h3>First column in master file is for loop index (1, 2, 3 ...):</h3>
  
  <pre><code>for i in {1..2}; do
      echo "$i" &gt;&gt; output.dat 
  done
  </code></pre>
  
  <h3>Second column in master file, SF1, (extract data from sf1.dat which is a single column file)</h3>
  
  <h3>Third column in master file, power, (extract data from power.dat which is also a single column file)</h3>
  
  <p>Outcome in 3 column format:</p>
  
  <pre class="lang-none prettyprint-override"><code>%eval_id      SF1      power
  1             23       300
  2             45       650
  </code></pre>