Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 2009 13:07:41 -0700
From:      Chad Perrin <perrin@apotheon.com>
To:        FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG>
Subject:   Re: need a newline between paragraphs....
Message-ID:  <20091124200741.GA1799@guilt.hydra>
In-Reply-To: <20091124013934.GA51279@thought.org>
References:  <20091124002920.GA51110@thought.org> <20091124003652.GH11723@hal.rescomp.berkeley.edu> <20091124013934.GA51279@thought.org>

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

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 23, 2009 at 05:39:35PM -0800, Gary Kline wrote:
>=20
> 	PS: is there any one-liner to add back one newline between
> 	paragraphs?

As someone else said -- that depends on how you define a "paragraph" in
the file.  If any time there's a newline you've got a new paragraph, you
can just use a simple substitution regex to replace all instances of one
newline with two newlines.  If some of your paragraphs are already
separated by two newlines, you could just use \n+ in the matching part of
your substitution regex to indicate that you want any instance of one or
more newlines in succession to be replaced with exactly two newlines --
if that doesn't screw up some other formatting you have in the file.

In order to answer this question properly, we'd need to know more about
how you define "paragraph" in this context, and whether there are special
cases of non-paragraph formatting that might cause conflicts with
paragraph formatting while doing a substitution.

--=20
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

--ibTvN161/egqYuK8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)

iEYEARECAAYFAksMPQ0ACgkQ9mn/Pj01uKWSxACfffqPjE2orcFxEWaZ7NOTVm02
ErUAoNcxpl+fC0EZv/+HlYL5afMopXKC
=/H4j
-----END PGP SIGNATURE-----

--ibTvN161/egqYuK8--



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