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 12:01:02 +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: <lENnQD.A.IQH.WTrX7@example.com>
- Resent-Sender: tlug-request@example.com
Thanks for the Perl cheat! Jc >From: Shimpei Yamashita <shimpei@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 20:42:19 +0900 > >On Wed, Jul 25, 2001 at 08:28:04AM +0000, Jean-Christian Imbeault wrote: > > 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 . . . > >I'm going to cheat and use a short perl script. :-p > >#! /usr/bin/perl -w > >$/ = undef; # slurp in the entire file using <STDIN> >while (<STDIN>) { > s/([^\n])\n([^\n])/$1 $2/g; # convert non-consecutive end-of-lines > # to space > print; >} > >Save this script as, say, concatLines, chmod it to 755, and run it like >this: > >col originalfile.txt | concatLines > output.txt > >-- >Shimpei Yamashita http://www.shimpei.org/ > >----------------------------------------------------------------------- >Next Nomikai Meeting: Fri, Aug 10 19:30- Tengu Tokyo Eki-Mae >Next Technical Meeting: Sat, Sep 15 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
Home | Main Index | Thread Index
- Prev by Date: Re: sed/vi how to concatenate all non-empty lines?
- Next by Date: Re: canuum, uum and nvi
- Prev by thread: Re: sed/vi how to concatenate all non-empty lines?
- Next by thread: canuum, uum and nvi
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links