title: Remove duplicates in text file line by line
body: <p>I'm trying to write a Python script that will remove duplicate strings in a text file. However, the de-duplication should only occur within each line.</p>
  
  <p>For example, the text file might contain:</p>
  
  <blockquote>
    <p>þ;ABC.001.123.1234;þ;;þ;10 ABC\ABCD\ABCDE;<strong>10 ABC\ABCD\ABCDE</strong>;þ<br>
    þ;ABC.001.123.1234;þ;;þ;10 ABC\ABCD\ABCDE;12 EFG\EFG;<strong>12 EFG\EFG</strong>;þ
    þ;ABC.001.123.1234;þ;;þ;10 ABC\ABCD\ABCDE;12 EFG\EFG;09 XYZ\XYZ\XYZ;<strong>12 EFG\EFG</strong>;þ</p>
  </blockquote>
  
  <p>Thus, in the above example, the script should only remove the bold strings.</p>
  
  <p>I've searched Stack Overflow and elsewhere to try to find a solution, but haven't had much luck. There seem to be many solutions that will remove duplicate lines, but I'm trying to remove duplicates within a line, line-by-line.</p>
  
  <p><strong>Update:</strong> Just to clarify - <code>þ</code> is the delimiter for each field, and <code>;</code> is the delimiter for each item within each field. Within each line, I'm attempting to remove any duplicate strings contained between semicolons. </p>
  
  <p><strong>Update 2:</strong> Example edited to reflect that the duplicate value may not always follow directly after the first instance of the value.</p>