From owner-freebsd-questions@FreeBSD.ORG Tue Nov 24 00:36:53 2009 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 88F0D1065676 for ; Tue, 24 Nov 2009 00:36:53 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: from hal.rescomp.berkeley.edu (hal.Rescomp.Berkeley.EDU [169.229.70.150]) by mx1.freebsd.org (Postfix) with ESMTP id 736718FC1B for ; Tue, 24 Nov 2009 00:36:53 +0000 (UTC) Received: by hal.rescomp.berkeley.edu (Postfix, from userid 1225) id D95C8597CFA; Mon, 23 Nov 2009 16:36:52 -0800 (PST) Date: Mon, 23 Nov 2009 16:36:52 -0800 From: Chris Cowart To: Gary Kline Message-ID: <20091124003652.GH11723@hal.rescomp.berkeley.edu> Mail-Followup-To: Gary Kline , FreeBSD Mailing List References: <20091124002920.GA51110@thought.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-ripemd160; protocol="application/pgp-signature"; boundary="Pgaa2uWPnPrfixyx" Content-Disposition: inline In-Reply-To: <20091124002920.GA51110@thought.org> Organization: RSSP-IT, UC Berkeley User-Agent: Mutt/1.5.20 (2009-06-14) Cc: FreeBSD Mailing List Subject: Re: need a newline between paragraphs.... 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: Tue, 24 Nov 2009 00:36:53 -0000 --Pgaa2uWPnPrfixyx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gary Kline wrote: > some several weeks ago, i got the appended perl code sent that > takes a very long txt file and diving by ``Chapter NN'' puts > the long file into seperate files, 01 to 66. trouble is that > it is hard to read by eyes without a space between paragraphs. >=20 > it's easy for grep to remove all newlines. How do i add them > back? [...] > # We've read at least one chapter heading. > while (<>) { > chomp; > $fh =3D newchapter($1) if /$regex/; > next if /^#/; It looks like this line of code is killing the blank lines. If you delete the line and re-run the program, you should be good to go. If you don't have the original anymore, it'll be a lot harder and much less accurate. > print $fh "$_"; > } Good luck, --=20 Chris Cowart Network Technical Lead Network & Infrastructure Services, RSSP-IT UC Berkeley --Pgaa2uWPnPrfixyx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iQIcBAEBAwAGBQJLCyqkAAoJEC8b9sM8ejXtsfoQAIxBSBNt9rgEXGxb0tG8eNtq Y0h6nIOKeiYWS+8RuYOvUMSr6HwE9RCJgc2/RZUi5VxHrdvxi5a8ZZEmtgIT1Ge1 ez75lX/xrALKiNnbiJUQhclYNxhNgEf+qZ6YJmshGW57xI9z6h2TKh1kGyIqwkg1 UhtwiRF6Zx61kiuDdup+kM7cWG+bru4pWPhhpUUMjAhZkiLGAlrdehxZix17cil3 9UF+aT+mNUNPC4CSoRsVNrbvTFvKG0i+QbIOthq3z78uAyTnz6+P+hJb0DsCKVmg lkCeqsLDHfqSsV3tWdAi4IPdak+0YJb2S+7+lEMvlv+WiPp4ovsVvXo2NShcwFCk ykLZu2UGcqLc38/nVshki4BJJXxvFkU2P3l8LqrQqRGlsZ/0r5DpNWbny6EDrlt+ n9qy56BeABAnlBJrPbf2/VnFZC0pgdWT8q2fy3oJbl7JXU6LBg/8f9pgIA/3JQmT c1mLlxSfy91TvszOcFRovr49fKZCgGiuEHVHmVpF6Xt2P7HaKMWyV5VZU9zq2xyn YmgczzMQLUw+jZJSSvHWZM8lHYNe7nR/Ria/cQUqR+4EVDuVRoXE+nmJfFbQrcXm dzewdh3i3lRMcgVDy1PhJTuSreF4ZMSPsikruekm4kqSWJKZVa5hBfqSsqeJv9Ta NbX5FHFnvxMgc5VcdhG7 =YWfh -----END PGP SIGNATURE----- --Pgaa2uWPnPrfixyx--