Date: Wed, 27 Oct 2010 23:38:40 -0700 From: Gary Kline <kline@thought.org> To: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: okay, time to ask the wizards. Message-ID: <20101028063840.GB9958@thought.org> In-Reply-To: <20101028012925.GA68456@guilt.hydra> References: <20101028010447.GA9734@thought.org> <AANLkTim=F14ocYZ8GnSVAFbTJ6QrXaxSsOKorbHEFwwa@mail.gmail.com> <20101028012925.GA68456@guilt.hydra>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 27, 2010 at 07:29:25PM -0600, Chad Perrin wrote: > On Wed, Oct 27, 2010 at 06:14:04PM -0700, Nerius Landys wrote: > > You mean replace each newline character with two newline characters? > > > > perl -p -i -e 's/\n/\n\n/g' yourfile.txt > Hm. Didn't think of perl; but yeah. > 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 I think the '$' wins because there might be an embedded newline. The pdf2html utility uses them to match the page-size of the PDF. > > Plus . . . I like pie. Yup. -g > > -- > Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix The 7.90a release of Jottings: http://jottings.thought.org/index.php http://journey.thought.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101028063840.GB9958>