title: Matching different columns and combine them using python
body: <p>I have two text files.</p>
  
  <p>The first is a space seperated list:</p>
  
  <pre><code>23 dog 4
  24 cat 5
  28 cow 7
  </code></pre>
  
  <p>The second is a <code>'|'</code>-separated list:</p>
  
  <pre><code>?dog|parallel|numbering|position
  Dogsarebarking
  ?cat|parallel|nuucers|position
  CatisBeautiful
  </code></pre>
  
  <p>I want to get an output file like the following: </p>
  
  <pre><code>?dog|paralle|numbering|position|23
  ?cat|parallel|nuucers|position|24
  </code></pre>
  
  <p>It's a <code>'|'</code>-separated list containing the values of the second file appended with the value from the first column of the first file where the values in the second column of both files match.</p>