title: Removing blank lines from text file using batch
body: <p>Recently <a href="https://stackoverflow.com/questions/47205813/removing-blank-lines-and-spaces-in-text-file-using-batch">this</a> question was posted on stackoverflow, I have a similar problem as J. Williams except I only need to remove empty lines (removing spaces would not hurt the program though, it just isn't necessary). When I tried his original as well as the solution compo gave it only cleared the file instead of removing extra lines. I'm using it by itself in a batch file.</p>
  
  <p>Example:
  I need this:</p>
  
  <pre><code>Joe
  Bob
  Mark
  Frank
  
  Dutch
  (blank line here too)
  </code></pre>
  
  <p>to become this:</p>
  
  <pre><code>Joe
  Bob
  Mark
  Frank
  Dutch
  </code></pre>
  
  <p>I'm open to attaching such a solution to this powershell script too, as it is what is giving me the blank lines: <code>(Get-Content friends.txt) | Where-Object {$_ -notmatch "\bJoe\b"} | Set-Content friends.txt</code> Thank's for your help.</p>