Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]RE: sed/vi how to concatenate all non-empty lines?
- To: tlug@example.com
- Subject: RE: sed/vi how to concatenate all non-empty lines?
- From: "Jean-Christian Imbeault" <jean_christian@example.com>
- Date: Wed, 25 Jul 2001 08:28:04 +0000
- Content-Type: text/plain; format=flowed
- Delivered-To: tlug@example.com
- List-Help: <mailto:tlug-request@example.comsubject=help>
- List-Post: <mailto:tlug@example.com>
- List-Subscribe: <mailto:tlug-request@example.comsubject=subscribe>
- List-Unsubscribe: <mailto:tlug-request@example.comsubject=unsubscribe>
- Old-Return-Path: <jean_christian@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <VeO74D.A.X0G.xLoX7@example.com>
- Resent-Sender: tlug-request@example.com
Update, col and the script you provided work fined, except that it removed all blank lines :) I was hoping to keep the blank lines as they separated the paragraphs from each other . . . Jc >From: OZAWA -Crouton- Sakuro <crouton@example.com> >Reply-To: tlug@example.com >To: tlug@example.com >Subject: RE: sed/vi how to concatenate all non-empty lines? >Date: Wed, 25 Jul 2001 13:09:43 +0900 > >At Wed, 25 Jul 2001 03:39:18 +0000, >Jean-Christian Imbeault wrote: > > > So how to I get sed or vi to concatenate all lines within a paragraph >into > > one linebut keep the empty lines between paragraphes? (i.e. concatenate >all > > consecutive non-empty lines together)? > >$ cat -s input.txt | sed join.sed > >join.sed is: BEGIN--cut here--cut here >#n > >/^ *$/!{ > H >} >/^ *$/{ > x > s/\n/ /g > s/^ // > p >} >${ > x > s/\n/ /g > s/^ // > p >} >END--cut here--cut here > >Don't forget '#n', or use 'sed -n' instead. > >-- >OZAWA -Crouton- Sakuro >E-Mail: mailto:crouton@example.com > Web: http://www.weatherlight.org/~crouton/ > PGP: C98F 74E0 AEEB 4578 1DFC F650 3BE0 9627 11FC C9F5 >VERBA VOLANT, SCRIPTA MANENT > >----------------------------------------------------------------------- >Next Nomikai Meeting: Fri, Aug 10 19:30- Tengu Tokyo Eki-Mae >Next Technical Meeting: Sat, Sep ?? 13:30- Akasaka Kumin Center >----------------------------------------------------------------------- >more info: http://www.tlug.gr.jp Sponsor: Global Online Japan > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
- Follow-Ups:
- RE: sed/vi how to concatenate all non-empty lines?
- From: OZAWA -Crouton- Sakuro <crouton@example.com>
- Re: sed/vi how to concatenate all non-empty lines?
- From: "A.Sajjad Zaidi" <sajjad@example.com>
- Re: sed/vi how to concatenate all non-empty lines?
- From: Shimpei Yamashita <shimpei@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: syslog2html or something?
- Next by Date: RE: sed/vi how to concatenate all non-empty lines?
- Prev by thread: Re: RE: sed/vi how to concatenate all non-empty lines?
- Next by thread: RE: sed/vi how to concatenate all non-empty lines?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links