Sample Header Ad - 728x90

Replacing Multiple blank lines with a single blank line in vim / sed

71 votes
7 answers
28229 views
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?
Asked by Andrew Bolster (1005 rep)
May 7, 2011, 08:19 PM
Last activity: May 16, 2025, 08:23 AM