title: extract multiple columns from multiple files with bash, awk or sed
body: <p>I am trying to extract column1 and column7 from the text files of two different directories. The names of files are same in these directories. I  need to save the outputs to another directory.</p>
  
  <pre><code>file1.txt in D1 directory
  
  column1  column2  column3  column7
  david    45.2       14.6   45.0
  grecy    12.0       0.0    12.0
  anjal    23.2       321.0  34.5
  
  file1.txt in D2 directory
  
  column1  column2  column3  column7
  david    45.2       14.6   56.0
  grecy    10.0       0.0    12.0
  moha     23.1       321.0  334.5
  
  output format (save the output as file1.txt in D3 directory)
  
  column1  column1  column7  column7
  david      david    45.0   56.0
  grecy      grecy    12.0   12.0
  anjal      moha     34.5   334.5
  </code></pre>
  
  <p>Your suggestions would be appreciated.</p>