Home > OS >  Sed to delete row two blank lines
Sed to delete row two blank lines

Time:11-03

Sed a great god, and I would like to ask about how sed to delete blank lines in a row, but not a single blank line to delete?
For example:
AAA

BBBBBBB


CCCCCCC

Delete the blank line between B and C is greater than or equal to 2 rows, but not to delete the line between A and B.

CodePudding user response:

Sed 'N./^ \ n/D 'a.t xt
This will remove empty lines in a row, but will retain a line
May not meet your request, but I can only do this step the

CodePudding user response:

Basically can satisfy my needs, I'll use N, but can't remember D
Thank you very much!
  • Related