title: Combining 2 .csv files by common column
body: <p>I have two .csv files where the first line in file 1 is:</p>
  
  <pre><code>MPID,Title,Description,Model,Category ID,Category Description,Subcategory ID,Subcategory Description,Manufacturer ID,Manufacturer Description,URL,Manufacturer (Brand) URL,Image URL,AR Price,Price,Ship Price,Stock,Condition
  </code></pre>
  
  <p>The first line from file 2:</p>
  
  <pre><code>Regular Price,Sale Price,Manufacturer Name,Model Number,Retailer Category,Buy URL,Product Name,Availability,Shipping Cost,Condition,MPID,Image URL,UPC,Description
  </code></pre>
  
  <p>and then rest of every file is filled with info.</p>
  
  <p>As you can see, both files have a common field called MPID (file 1: col 1, file 2: col 9, where the first col is col 1).</p>
  
  <p>I would like to create a new file which will combine these two files by looking at this column (as in: if there is an MPID that is in both files, then in the new file this MPID will appear with both its row from file 1 and its row from file 2). IF one MPID appears only in one file then it should also go into this combined file. </p>
  
  <p>The files are not sorted in any way.</p>
  
  <p>How do I do this on a debian machine with either a shell script or python?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT: Both files dont have commas other than the ones separating the fields. </p>