How Do I Remove Blank Lines in Unix?
Contents You Can Use the -v Option with Grep to Remove the Matching Empty Lines. How Do I Remove Blank Lines in Linux? the D Command in Sed Can Be Used to...
Contents
You can use the -v option with grep to remove the matching empty lines.
How do I remove blank lines in Linux?
The d command in sed can be used to delete the empty lines in a file. Here the ^ specifies the start of the line and $ specifies the end of the line. You can redirect the output of above command and write it into a new file.
Must Read
How do I delete blank lines in vi?
:g/^$/d – Remove all blank lines.