delete empty paragraphs without picking up formats of following para/section?

S

simon

Folks,

How can I use find/replace to delete extra empty paragraphs in my doc
without messing up headings and other formats of following para/sections?

tx, Simon
 
S

simon

I was thinking more along the lines of find [^13]{2,100} replace with ^13^13
but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've used is to
hide text (by modifying the style font proerties) that may interfere with
the find/replace but it seems you have to turn off Show All formatting.

s
 
J

Jezebel

Replacing paragraphs with ^13 is your problem: in the replace string, ^13
and ^p are not the same. This is a classic Word gotcha. ^13 in the replace
string inserts a pilcrow character and a line break, which looks exactly as
if you had inserted a paragraph break; but it's not. These are characters
*within* the paragraph. If you select the entire paragraph, you'll see it
spans all the pilcrow characters you inserted in this fashion. So the
replacement you are using is turning your document into one big paragraph --
and it thus inherits all the formatting of the final paragraph.





simon said:
I was thinking more along the lines of find [^13]{2,100} replace with
^13^13 but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've used is to
hide text (by modifying the style font proerties) that may interfere with
the find/replace but it seems you have to turn off Show All formatting.

s

Jezebel said:
Find ^p^p, replace with ^p
 
J

Jay Freedman

Turn on "Use wildcards". Find (^13)^13{1,} and replace with \1 .
That will preserve any style or formatting that's applied to the first
paragraph mark. Also note that you don't need to supply a maximum
number of repetitions in the braces.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I was thinking more along the lines of find [^13]{2,100} replace with ^13^13
but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've used is to
hide text (by modifying the style font proerties) that may interfere with
the find/replace but it seems you have to turn off Show All formatting.

s

Jezebel said:
Find ^p^p, replace with ^p
 
S

simon

Awesome trick Jay. I used (^13{2})^13{1,} because I wanted to preserve one
line between paragraphs. Thanks for heads up about not needing a max in the
braces.

Jay Freedman said:
Turn on "Use wildcards". Find (^13)^13{1,} and replace with \1 .
That will preserve any style or formatting that's applied to the first
paragraph mark. Also note that you don't need to supply a maximum
number of repetitions in the braces.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I was thinking more along the lines of find [^13]{2,100} replace with
^13^13
but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've used is
to
hide text (by modifying the style font proerties) that may interfere with
the find/replace but it seems you have to turn off Show All formatting.

s

Jezebel said:
Find ^p^p, replace with ^p



Folks,

How can I use find/replace to delete extra empty paragraphs in my doc
without messing up headings and other formats of following
para/sections?

tx, Simon
 
G

Graham Mayor

See http://www.gmayor.com/replace_using_wildcards.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Awesome trick Jay. I used (^13{2})^13{1,} because I wanted to
preserve one line between paragraphs. Thanks for heads up about not
needing a max in the braces.

Jay Freedman said:
Turn on "Use wildcards". Find (^13)^13{1,} and replace with \1 .
That will preserve any style or formatting that's applied to the
first paragraph mark. Also note that you don't need to supply a
maximum number of repetitions in the braces.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I was thinking more along the lines of find [^13]{2,100} replace
with ^13^13
but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've
used is to
hide text (by modifying the style font proerties) that may
interfere with the find/replace but it seems you have to turn off
Show All formatting. s

Find ^p^p, replace with ^p



Folks,

How can I use find/replace to delete extra empty paragraphs in my
doc without messing up headings and other formats of following
para/sections?

tx, Simon
 
S

simon

Graham - tx for the ref to the updated tutorial

Graham Mayor said:
See http://www.gmayor.com/replace_using_wildcards.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Awesome trick Jay. I used (^13{2})^13{1,} because I wanted to
preserve one line between paragraphs. Thanks for heads up about not
needing a max in the braces.

Jay Freedman said:
Turn on "Use wildcards". Find (^13)^13{1,} and replace with \1 .
That will preserve any style or formatting that's applied to the
first paragraph mark. Also note that you don't need to supply a
maximum number of repetitions in the braces.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.


I was thinking more along the lines of find [^13]{2,100} replace
with ^13^13
but either method still seems to encounter the
formatting-of-following-section issue. The other technique I've
used is to
hide text (by modifying the style font proerties) that may
interfere with the find/replace but it seems you have to turn off
Show All formatting. s

Find ^p^p, replace with ^p



Folks,

How can I use find/replace to delete extra empty paragraphs in my
doc without messing up headings and other formats of following
para/sections?

tx, Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top