title: How to merge two CSV files with Linux column wise?
body: <p>I am looking for a simple line of code (if possible) to simply merge two files column wise and save the final result into a new file.</p>
  
  <p>Edited to response to the first answer @heitor:</p>
  
  <p>By using <code>paste file1.csv file2.csv</code>, What happened is:</p>
  
  <p>For instance file 1:</p>
  
  <pre><code>A B
  1 2
  </code></pre>
  
  <p>file2:</p>
  
  <pre><code>C D
  3 4
  </code></pre>
  
  <p>By doing <code>paste -d , file1.csv file2.csv &gt;output.csv</code> I got</p>
  
  <pre><code> A B
   C D
   1 2
   3 4
  </code></pre>
  
  <p>not</p>
  
  <pre><code>A B C D
  1 2 3 4
  </code></pre>
  
  <p>By doing <code>cat file1.csv file2.csv</code> I got</p>
  
  <pre><code>A B 
  1 2
  C D
  3 4
  </code></pre>
  
  <p>Neither of them is what I want. Any idea?</p>
  
  <p>Any idea?</p>