Ask Your Question

Find and replace double paragraph breaks & make paragraphs continuous

asked 2019-09-03 19:05:25 +0100

LI gravatar image

updated 2020-08-16 12:19:42 +0100

Alex Kemp gravatar image

I need to record this in a macro, so cannot use alternative find and replace. I want to find (and replace) double paragraph marks, and triple as well if possible, to remove large amounts of empty space in a document.

Then I can replace single paragraph marks with a single space to make the remaining paragraphs continuous text.

When I search for "$$" or "$$$" it does not work. Is there another approach?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2019-09-03 22:26:51 +0100

RGB-es gravatar image

updated 2019-09-04 08:54:20 +0100

EDIT: OK, there is no need for macros or RegExp. Go to Tools → AutoCorrect → AutoCorrect Options → Options tab and activate the option Remove blank paragraphs (also, deactivate anything you don't want), now go to Tools → AutoCorrect → Apply and the empty paragraph will be removed.

I even wrote about this a few months ago... my memory is no longer what it used to be...

If there are no spaces on those empty paragraph, you can search for


and replace with nothing. If there are spaces (any type, including tab stops), you need to first delete those spaces by searching for


and replacing by nothing, and then perform the first action to delete those empty lines.

edit flag offensive delete link more


Thanks, I did not know about this option. However, it has a couple drawbacks.

(a) Afterwards you have to turn all the options you want back on again, and then repeat these steps every time you want to apply to a document, whereas if you create a macro as per my chosen solution below you can just apply it quickly any time.

(b) And I still have the challenge of joining paragraphs that are broken up, as in my solution example below. This still requires me to find the double paragraph marks, the ones I will want to keep for real paragraph separation, and replace them with something like "paragraph2" as in my solution, then replace the single paragraph marks with space to join the text paragraphs into continuous text, then change "paragraph2" back to two paragraph marks.

LI gravatar imageLI ( 2019-09-04 14:21:19 +0100 )edit

answered 2019-09-03 23:30:25 +0100

LI gravatar image

updated 2019-09-03 23:38:21 +0100

Here is the solution I choose. It also addresses my larger problem, that I have line breaks in paragraphs when I want continuous text.

That is, I want to turn the following:

<===== START EXAMPLE =====>

Some text followed by four paragraph marks that should only be two.

A paragraph
with paragraph marks
that should be continuous.

<===== END EXAMPLE =====>

Into this:

<===== START EXAMPLE =====>

Some text followed by three paragraph marks that should only be two.

A paragraph with paragraph breaks that should be continuous.

<===== END EXAMPLE =====>

Steps to the solution, using regular find and replace:

  1. Replace all "$" with "paragraph1".

  2. Replace all "paragraph1paragraph1paragraph1paragraph1" with "paragraph4".

  3. Replace all "paragraph1paragraph1paragraph1" with "paragraph3".

  4. Replace all "paragraph1paragraph1" with "paragraph2".

  5. Replace all "paragraph1" with " " (i.e. a space).

  6. Replace all "paragraph4" with "\n\n".

  7. Replace all "paragraph3" with "\n\n".

  8. Replace all "paragraph2" with "\n\n".

This is recordable by macro using regular find and replace.

Always a way!

edit flag offensive delete link more

answered 2019-09-04 07:52:02 +0100

gabix gravatar image
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-03 19:05:25 +0100

Seen: 947 times

Last updated: Sep 04 '19