title: Python side-by-side merge of comma-delimited text files
body: <p>Suppose I have two text files with the content shown below.</p>
  
  <p><strong>Text file 1:</strong></p>
  
  <pre><code>Apple, 0
  Pear,  1
  Orange, 0
  </code></pre>
  
  <p><strong>Text file 2:</strong></p>
  
  <pre><code>Apple, 1
  Pear, 1
  Orange, 1
  </code></pre>
  
  <p>I wish to merge them in a side-by-side fashion, keeping only the left "column", which is identical for both text files, of text file 1.  That is, I wish to produce the following merged text file.</p>
  
  <p><strong>Merged text file:</strong></p>
  
  <pre><code>Apple, 0, 1
  Pear, 1, 1
  Orange, 0, 1
  </code></pre>
  
  <p>I'm trying to find how to---in a reasonably small amount of code---perform such a merge. But, in the real problem, there can be any number of text files.  How can I do this in Python?</p>
  
  <p>Assumptions:</p>
  
  <ol>
  <li>Every text file will have exactly the same number of rows.</li>
  <li>Every text file will be a comma delimited file with exactly 1 comma per line.</li>
  <li>For every row in every text file, the value to the left of the comma is exactly the same.</li>
  </ol>