Re: to remove leading and trailing blank lines
prem <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
Try thisecho -e " cccc\n dddddd \neeeeeee \nfffff" | sed -e '/^ /d' -e '/ $/d' From: Davide Brini <[email protected]> >To: [email protected] >Sent: Monday, July 1, 2013 5:38 AM >Subject: Re: to remove leading and trailing blank lines > > >On Mon, 01 Jul 2013 10:24:43 -0000, "contact2vikas" ><[email protected]> wrote: > >> Hello, >> I want to remove/delete leading and trailing blank lines from a file. > >Try this: > >sed ' > >/./,$b ok > >d > >:ok > >/^\n*$/{ > $d > N > b ok >} > >' file > > > >-- >D. > > >------------------------------------ > >-- >Yahoo! Groups Links > > > > > > [Non-text portions of this message have been removed]