From owner-freebsd-questions@FreeBSD.ORG Thu Oct 28 06:39:00 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F4AC106567A for ; Thu, 28 Oct 2010 06:39:00 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 258E68FC13 for ; Thu, 28 Oct 2010 06:38:59 +0000 (UTC) Received: by thought.org (Postfix, from userid 1001) id C54F1E823E8; Wed, 27 Oct 2010 23:38:40 -0700 (PDT) Date: Wed, 27 Oct 2010 23:38:40 -0700 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20101028063840.GB9958@thought.org> References: <20101028010447.GA9734@thought.org> <20101028012925.GA68456@guilt.hydra> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101028012925.GA68456@guilt.hydra> X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 24 years of service to the Unix community. User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: okay, time to ask the wizards. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 06:39:00 -0000 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