11 Apr

sed: replacing multiple empty lines with one

As simple as:

sed -e '/^$/N;/^\n$/D' <file>


Leave a Reply

Your email address will not be published. Required fields are marked *