[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: script to remove blank lines ?



Hi,

On Tue, Aug 10, 1999 at 12:25:03PM +0530, venu wrote:

> if in a file I have say 10 lines and some of them are blank lines ,how do i
> remove the blank lines ?

grep -v ^$ <filename>

This gets you all lines with "something" between the line's beginning (^)
and its end ($).  Or rather "without nothing" between beginning and
end (-v is grep's negation option).

So long -- Stephan
-- 
Stephan Engelke                                    engelke@math.uni-hamburg.de
     *** Plug-and-Play is really nice, unfortunately it only works 50% of
                 the time.  To be specific the "Plug" almost always works. ***


Reply to: