title: groovy: How to remove lines from a file that begin with a non unique string
body: <p>*** Edited example to show order is not a factor</p>
  
  <p>I have a file with the content:</p>
  
  <pre><code>ABC-123 BLA bla&lt;/br&gt;
  ABC-123 lala lala&lt;/br&gt;
  ABC-234 AAA&lt;/br&gt;
  ABC-123 CCC&lt;/br&gt;
  ABC-567 ddd&lt;/br&gt;
  ABC-234 BBB&lt;/br&gt;&lt;/br&gt;
  </code></pre>
  
  <p>I would like to remove the lines that have a preceding line that begins with the same string and end up with a file containing (or a String containing):</p>
  
  <pre><code>ABC-123 BLA bla 
  ABC-234 AAA
  ABC-567 ddd
  </code></pre>
  
  <p>Currently my code just saves the contents of the file into a string:</p>
  
  <pre><code>if (new File('description.txt').length() &gt; 0 ) {
      description = new File('description.txt').text
  }
  </code></pre>
  
  <p>I'd like to either update the file or save the first 'non unique' lines plus unique lines in the description string.</p>