need a newline between paragraphs....

Chad Perrin perrin at apotheon.com
Tue Nov 24 20:14:23 UTC 2009


On Mon, Nov 23, 2009 at 05:39:35PM -0800, Gary Kline wrote:
> 
> 	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.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091124/7bd08e4f/attachment.pgp


More information about the freebsd-questions mailing list