okay, time to ask the wizards.

Chad Perrin perrin at apotheon.com
Thu Oct 28 01:16:26 UTC 2010


On Wed, Oct 27, 2010 at 06:04:50PM -0700, Gary Kline wrote:
> I've got a very large file with paragraphs separated only by "\n".
> How do I put a blank line _after_ each newline?

    perl -e 'while (<>) { s/$/\n/; print; }'

You could also open the file in vi or Vim and give it this command:

    :%s/$/^M/

Note that you don't type in that ^M by using the ^ and M keys on the
keyboard.  Instead, you first type ctrl-v then press the Enter key.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20101028/f7c8ac9b/attachment.pgp


More information about the freebsd-questions mailing list