Date: Wed, 27 Oct 2010 19:29:25 -0600 From: Chad Perrin <perrin@apotheon.com> To: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: okay, time to ask the wizards. Message-ID: <20101028012925.GA68456@guilt.hydra> In-Reply-To: <AANLkTim=F14ocYZ8GnSVAFbTJ6QrXaxSsOKorbHEFwwa@mail.gmail.com> References: <20101028010447.GA9734@thought.org> <AANLkTim=F14ocYZ8GnSVAFbTJ6QrXaxSsOKorbHEFwwa@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Oct 27, 2010 at 06:14:04PM -0700, Nerius Landys wrote:
> You mean replace each newline character with two newline characters?
>=20
> perl -p -i -e 's/\n/\n\n/g' yourfile.txt
The g in that is unnecessary. I'd also be inclined to use $ in the
matching part of that regex than \n, and only require one newline
character in the substitution part as a result:
perl -pie 's/$/\n/' filename.txt
Plus . . . I like pie.
--=20
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
--fUYQa+Pmc3FrFX/N
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)
iEYEARECAAYFAkzI0fUACgkQ9mn/Pj01uKWZDwCeNlp2mx2K93RVEyaqDj8aSnkH
R2cAoLDR7nM99f/2CuMgagcUld55vqfp
=TE3N
-----END PGP SIGNATURE-----
--fUYQa+Pmc3FrFX/N--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101028012925.GA68456>
