![]() |
|
#1
|
|||
|
|||
|
We have text like this:
Start: {paragraph return} line 1; {paragraph return} line 2; {paragraph return} ending line.{paragraph return} That is, everything but the ending line could have a colon, semicolon, comma..., but ONLY the "ending line" has a period. This is the only period. I want to end up with: Start: line 1; line 2; ending line.{paragraph return} I already have code that manipulates this for various reasons. I will add code that searches for "space ^p" (a space and then a paragraph return) and replaces with just "^p" (a paragraph return). I'll run this a few times, so that I should end up with "character ^p", each line ending with some type of character then an immediate paragraph return. What I would like to implement is the following: If the line does not end with a ".^p" but does end with a "^p", replace the "^p" with a space. This removes the paragraph return from every line but those that end with a period and paragraph return. I could "brute force" this by replacing all ";^p" with a space, all ",^p" with a space, ":^p" with a space. But is there a more elegant way of doing this? |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Split apart "page break" and "paragraph mark" | EwenMc | Word | 4 | 10-03-2021 02:12 AM |
Conditional tied to trying to find a " " space character
|
Dart82 | Word VBA | 3 | 10-04-2013 01:47 PM |
| Wierd symbols inplace of "space", "indentation" etc | aka.bhagvanji | Word | 5 | 02-16-2012 11:50 AM |
The heading doesn't "obey" the "before" space! why?
|
Jamal NUMAN | Word | 1 | 07-06-2011 04:25 AM |
Replacing a single "l" with a double "ll"
|
MShroff | Word | 8 | 01-19-2011 08:43 AM |