title: Python-Replacing Duplicatte information in a Text file
body: <p>I am currently working on a program that puts each word in a text file into xlsxwriter. It means I have to split the lines.</p>
  
  <p>My problem is that I have to get rid of the duplicate information until first different element in a line. I can't come up with an idea regarding how to tackle it.</p>
  
  <p>Text Example</p>
  
  <pre><code>Dave likes fresh green apples 
  Dave likes fresh green peppers 
  Dave hates fresh green apples 
  Dave hates rotten green apples 
  Jane likes fresh green apples
  </code></pre>
  
  <p>Desired Outcome in xlsxwriter </p>
  
  <pre><code>    C1    C2    C3    C4    C5 
  R1 Dave likes fresh  green apples 
  R2  X     X     X      X   peppers 
  R3  X   hates fresh  green apples 
  R4  X     X   rotten green apples 
  R5 Jane likes fresh  green apples
  </code></pre>
  
  <p>Thanks</p>