#1
|
|||
|
|||
Replacing random paragraph endings in text
I have a GROUP of LARGE documents that were improperly formatted so they contain paragraph breaks in random places where they should not. I have figured out that almost all of them occur where there is a lower case letter preceeding the error. So searching for [a-z]^13 finds them. But replacing the paragraph character with a space also deletes the preceeding character, so that doesn’t help. I need a way to find and replace only the paragraph character without deleting the preceeding (correct) character.
If I could FIND, move forward one character and then replace, that should work. I don’t know how to do that except manually, and that would take months. Any ideas? Thank you. JP91306 |
#2
|
||||
|
||||
Try, for example, a wildcard Find/Replace with:
Find = ([a-z,])^13 Replace = \1^32 You may also be interested in some of the concepts explored in the 'Cleaning up Text Pasted from Websites, E-mails, PDFs etc.' thread at the top of this forum (https://www.msofficeforums.com/word/...s-e-mails.html).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
That ALMOST works. It does remove the PARAGRAPH mark, but it ALSO adds a space before the "final" letter in the word that precedes the PARAGRAPH mark. . so... [word][paragraph char] becomes [wor d] . ...so that doesn't quite work. I don't understand some of the code so I couldn't guess how to fix it. Thanks, jp
|
#4
|
||||
|
||||
Unless you inserted a space before the \1 in the Replace expression, that wouldn't happen. The ^32 inserts a space where the paragraph break was.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replacing paragraph formatting before column break also changes the next paragraph after the break | jjmartin1340 | Word | 3 | 09-21-2015 10:50 PM |
Replacing the 2nd or 3rd instance of Text | wdillon2 | Word VBA | 2 | 05-13-2015 10:21 PM |
Problem replacing text. | piritzo | Word | 2 | 06-22-2013 12:50 AM |
Help with replacing text with wildcards | sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |