Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2010 19:10:55 -0600
From:      Chad Perrin <perrin@apotheon.com>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>, Gary Kline <kline@thought.org>
Subject:   Re: okay, time to ask the wizards.
Message-ID:  <20101028011055.GA68350@guilt.hydra>
In-Reply-To: <20101028010447.GA9734@thought.org>
References:  <20101028010447.GA9734@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.

--=20
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkzIzZ8ACgkQ9mn/Pj01uKXs2wCfa7RQAdouWfpFd28WMW9mcBvf
tEkAoIZ7e0gIbH2+zI9jeHNHiygwQpuP
=MS0w
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101028011055.GA68350>