Question more or less says it all. I'm aware that /^$/d will remove all blank lines, but I can't see how to say 'replace two or more blank lines with a single blank line'
Any ideas?
|
Question more or less says it all. I'm aware that Any ideas? |
|||
|
|
|
If you aren't firing vim or sed for some other use, cat actually has an easy builtin way to collapse multiple blank lines, just use If you were already in vim and wanted to stay there, you could do this with the internal search and replace by issuing: |
|||||
|
|
If in Vim, just do this:
|
|||||
|
|
Use
|
|||
|
|