title: Python - Trying to compare two text files that are formatted differently
body: <p>File 1 is formatted like this:</p>
  
  <pre><code>1111111111
  2222222222
  </code></pre>
  
  <p>File 2 is formatted like this:</p>
  
  <pre><code>3333333333:4444444444
  1111111111:2222222222
  </code></pre>
  
  <p>I am trying to figure out a way to take the stuff in file one and see if it matches with <em>only</em> the stuff to the <em>right</em> of the colons in file two. The ultimate goal is to remove the FULL line in file two if there is a match. </p>
  
  <p>I know I can cut file 2 using standard commands so they're formatted exactly the same. The problem is I need the finished file in 88888:99999 format and it seems too complicated to split them up only to put them back in the right order. </p>
  
  <p>I've tried nesting for loops, regex, sets, lists, my head is spinning.</p>
  
  <p>I hope this makes sense. Thanks in advance.</p>
  
  <pre><code>Traceback (most recent call last):
   File "test.py", line 17, in &lt;module&gt;
     if line.split(":")[1] in keys:
  IndexError: list index out of range
  </code></pre>