title: How to merge lines that start with the same items in a text file
body: <p>I have a text file containing some thousand lines as follows:</p>
  
  <p><strong>File:</strong></p>
  
  <pre><code>abc: bla1 bla1 bla1... 
  cde: bla bla bla... 
  ghk: bla1 bla1 bla1... 
  lmn: bla bla bla...
  abc: bla2 bla2 bla2... 
  bcd: bla bla bla... 
  ghk: bla2 bla2 bla2... 
  xyz: bla bla bla...
  </code></pre>
  
  <p>I want to merge all the lines that start with the same items (as <code>1 and 5, 3 and 7</code>) so that I have  a new text file like this:</p>
  
  <p><strong>New File:</strong></p>
  
  <pre><code>abc: bla1 bla1 bla1... * abc: bla2 bla2 bla2... 
  cde: bla bla bla... 
  ghk: bla1 bla1 bla1... * ghk: bla2 bla2 bla2...
  lmn: bla bla bla...
  bcd: bla bla bla...   
  xyz: bla bla bla...
  </code></pre>
  
  <p>I wonder if this is possible to be solved using <code>regex</code> and/or <code>grep</code>, and if yes then how can I solve it?</p>
  
  <p>I'm quite familiar with <code>grep</code> because I'm on TextWrangler, but also OK with other text editors.</p>
  
  <p>Help much appreciated. </p>