Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Nov 2009 16:36:52 -0800
From:      Chris Cowart <ccowart@rescomp.berkeley.edu>
To:        Gary Kline <kline@thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG>
Subject:   Re: need a newline between paragraphs....
Message-ID:  <20091124003652.GH11723@hal.rescomp.berkeley.edu>
In-Reply-To: <20091124002920.GA51110@thought.org>
References:  <20091124002920.GA51110@thought.org>

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

--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--



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