[plug] A question about using sed - removing blank lines

Nick Bannon nick at ucc.gu.uwa.edu.au
Fri Apr 25 17:45:45 WST 2008


On Fri, Apr 25, 2008 at 05:27:22PM +0800, Arie Hol wrote:
> I suppose I should have mentioned that I am using GNU Utils for Windows - 
> :-)

Hmm, should work, but my suggestion with ^V^I might be harder to type.
Might work if you use Notepad to put the command into a .SH or .BAT file.

[...]
> I have tried all of the following commands :

What they have in common is that they are all s/// substitution commands
to replace one line with another. Try my or Craig's suggestion, which
is just a // match statement followed by (p)rint or (d)elete.

Craig's suggestion means "if you find a line with only spaces in it,
delete it". My suggestion means "Don't print anything. If you find a
line with a non-space in it, print it."

Nick.

-- 
   Nick Bannon   | "I made this letter longer than usual because
nick-sig at rcpt.to | I lack the time to make it shorter." - Pascal




More information about the plug mailing list