title: Appending columns to a file using awk
body: <p>I have a somewhat long awk script and I want to append two columns at the "right hand side" of the file. I have the following file in progress:</p>
  
  <pre><code>Node    temporary_Temperature   steady_Temperature  temporary_Sight steady_Sight    
  1                   x                   x                   -                   -                   
  2                   x                   x                   -                   -                   
  3                   -                   -                   -                   -                   
  4                   -                   -                   -                   -                   
  5                   x                   x                   x                   -                   
  6                   -                   -                   -                   -                   
  7                   -                   -                   -                   -                   
  8                   -                   -                   -                   -                   
  9                   -                   -                   -                   -                   
  10                  -                   -                   -                   -                   
  11                  -                   -                   -                   -                   
  12                  -                   -                   -                   -                   
  13                  x                   x                   -                   -                   
  14                  x                   x                   -                   -                   
  15                  x                   -                   -                   -                   
  16                  -                   -                   -                   -                   
  </code></pre>
  
  <p>The data are already written to a file and I want to iterate the lines in this file using awk and, let's say, append two more columns. At the header row I want to append the columns <code>foo</code> and <code>bar</code>, and thereafter append <code>x</code> or <code>-</code> to each line depending on other stuff. How can I achieve this? Since I am in the middle of a longer script I do not want to use sed unless there is some way to invoke sed from within an awk script amd print to the same file?</p>