title: If Partial Duplicate on Line, Remove Line
body: <p>I have a file with 400+ lines, but some of the lines have partial duplicates. Below is a simplified version.</p>
  <p>file.txt:</p>
  <pre><code>A_12_23 A_12_34 B_12_23 B_12_34
  A_1_34 A_23_34 B_1_12 B_1_23
  </code></pre>
  <p>The fields are whitespace-separated where the letter before the first underscore is an identifier and the values after the first underscore are its values. A partial duplicate is one where one of the fields for A has the same values after the underscore as one of the B fields. The lines are sorted so that the A fields are always before the B fields.  There are no other identifiers.</p>
  <p>What I would like to do is remove any line with a partial duplicate.</p>
  <p>output.txt:</p>
  <pre><code>A_1_34 A_23_34 B_1_12 B_1_23
  </code></pre>
  <p>How would I go about doing this? I know how to remove exact duplicates on a line by:</p>
  <pre><code>awk '$1!=$2' file.txt &gt; output.txt     # Can use various combinations if needed
  </code></pre>
  <p>I am not sure about about partial duplicates. For example: 12_23 is repeated two times on the first line, so I want it deleted. Stopping at deleting duplicated partial strings is okay since it will also delete if repeated more.</p>
  <p>Please let me know how I can improve this question. Thanks in advance!</p>