Developer OneNote

Emma's OneNote for Microsoft Windows, Office and Programming

Tag: Notepad++

Delete blank lines from text file

22 March, 2010 | Category: Development, Tips and Tricks

This note is for a few quick ways to delete all blank lines from a text file.

  1. sed ‘/^$/d’ file > file_new
  2. grep -v "^$" file > file_new
  3. (This is for Notepad++ users) Select all text (shortcut Ctrl+A) and then click Menu TextFX -> TextFX Edit -> Delete Blank Lines

delete blank lines in notepad++