title: Merge tab-delimited files horizontally with files of different row lengths
body: <p>I am a complete novice in programming, so I apologize for any lack of clarity, extreme confusion, etc. What I am trying to do is merge a large number of files into one file. Each file is tab-delimited with the same number of columns (13), but a different number of rows (~40000). I would like the end product to contain</p>
  
  <pre><code>file1col1      file1col2   ...   file1col13    file2col1      file2col2   ...   file2col13    file3col1      ...         etc
  </code></pre>
  
  <p>(where all the spaces are tabs)</p>
  
  <p>The end of the files could be padded any which way, as long as all of my columns are preserved.</p>
  
  <p>What I was trying to do was to simply use the paste command in unix; however, that was not preserving my columns. I tried poaching solutions from a bunch of slightly different questions, but I'm afraid that I'm such a beginner that I didn't even know how to do that. I would prefer to use unix or python to solve this problem, but I'm open to any suggestions.</p>
  
  <p>Thanks in advance for any help you can provide!</p>
  
  <p>P.S. I am doing this with a large number of files (~40), so if the input could take all files in a given directory with the same extension, that would be ideal.</p>
  
  <p>Edit: While <code>paste -D$'\t' *.b &gt; merge</code> works for the first section of the file, outputting</p>
  
  <pre><code>9       13577718        0       0       0       1       0       0       0       0       0       0       0       9       13576563        1       0       0       0       0       0       0       0       0       0       0       9       13577772        0       0       1       0       0       0  ...etc across
  </code></pre>
  
  <p>At the end of the file (viewed using tail), everything becomes jumbled and misaligned. I'm not sure how to best represent this and I do not have the reputation to post images.</p>