title: How to merge multiple columns of different text columns
body: <p>I have got multiple text files, which i seprated from one text file , now i want to merge them with <code>,</code> seprated form but column with the sequence</p>
  
  <p>data1.txt</p>
  
  <pre><code>A man in the park
  
  A man in the ground
  
  A man is running
  </code></pre>
  
  <p>data2.txt</p>
  
  <pre><code>Yes1
  
  No1
  
  Why not1
  </code></pre>
  
  <p>data3.txt</p>
  
  <pre><code>Yes2
  No2
  Why not2
  </code></pre>
  
  <p>data4.txt</p>
  
  <pre><code>Yes3
  No3
  Why not3
  </code></pre>
  
  <p>data5.txt</p>
  
  <pre><code>Yes4
  No4
  Why not4
  </code></pre>
  
  <p>How can I merge these data files into a comma separated values (<a href="/questions/tagged/csv" class="post-tag" title="show questions tagged &#39;csv&#39;" rel="tag">csv</a>) file using <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged &#39;c++&#39;" rel="tag">c++</a>?</p>
  
  <pre><code>1,A man in the park,Yes1,Yes2,Yes3,Yes4
  2,A man in the ground,No1,No2,No3,No4
  3,A man is running,Why not1,Why not2,Why not3 , Why not4
  </code></pre>
  
  <p>I saw <a href="https://stackoverflow.com/questions/4672600/merging-two-text-files-into-one-csv-file">related</a> questions about it but its not related to <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged &#39;c++&#39;" rel="tag">c++</a></p>