title: Merge two blank lines into one
body: <p>I am looking for a solution of turning file A to file B, which requires merging two blank lines into one.</p>
  
  <p>File-A:</p>
  
  <pre><code>// Comment 1
  // Comment 2
  
  // Comment 3
  
  
  // Comment 4
  
  
  
  // Comment 5
  </code></pre>
  
  <p>File-B:</p>
  
  <pre><code>// Comment 1
  // Comment 2
  
  // Comment 3
  
  // Comment 4
  
  // Comment 5
  </code></pre>
  
  <p>From <a href="https://stackoverflow.com/questions/16414410/delete-empty-lines-using-sed">this post</a>, I know how to delete empty lines, I am wondering how to merge two consecutive blank lines into one.</p>
  
  <p><strong>PS: blank means that it could be empty OR there might be a tab or a space in the line.</strong></p>