okay, time to ask the wizards.

Wayne Sierke ws at au.dyndns.ws
Thu Oct 28 15:20:27 UTC 2010


On Thu, 2010-10-28 at 15:18 +1030, Wayne Sierke wrote:
> > On Wed, Oct 27, 2010 at 6:04 PM, Gary Kline <kline at thought.org> wrote:
> > 
> > > I've got a very large file with paragraphs separated only by "\n".
> > > How do I put a blank line _after_ each newline?
<snip>
> In this particular case however, sed does offer the "pièce de
> résistance":
> 
>         sed G

Mea culpa. Someone contacted me off-list querying the validity of my sed
statement which highlighted that my solution description was overly
terse.

Of course what I was suggesting was:

        sed G sourcefile

and practically used as something like:

        sed G sourcefile > newfile

or:

        sed -i .orig -e G sourcefile

e.g.:

        %cat > sourcefile
        Line one.
        Line two.   
        Line three.
        %D
        %sed G sourcefile
        Line one.
        
        Line two.   
        
        Line three.
                
        %


Wayne




More information about the freebsd-questions mailing list