#1
|
|||
|
|||
Using find/replace to insert a word while retaining wildcard-found text
I'm sure this is possible, but I can't figure it out.
I often have a numbered list of items. Not Word-formatted numbering, but rather plain-text numbering, such as 1. An apple 2. A pear 3. Horses 4. Donkey (I note that the gap between the period and the list item is normally a tab rather than a space.) I'd like to use find-replace to end up with: Example 1. An apple Example 2. A pear Example 3. Horses Example 4. Donkey For reasons that are complicated to explain, I cannot use the paragraph-end mark of the previous item as part of the string to find. For example, finding ^p and replacing it with ^pExample won't work in my situation. Instead, I need to be able to find any number followed by a period, and replace it with the same text, just with the prefix "Example ". My lack of find-replace skills means that I don't know how to tell Word to replace the found number with whatever number was found in each case. The closest that I came was, with wildcards switched on: find: ([0-9]{1,}.) replace: Example \1 but for reasons I simply cannot even imagine, the result is: Exampl1.e An apple Exampl2.e A pear Exampl3.e Horses Exampl4.e Donkey Making it even more confusing, is that if I do this: find: ([0-9]{1,}.)^t replace: Example \1^t the result is: Examp1.le An apple Examp2.le A pear Examp3.le Horses Examp4.le Donkey If a macro is a better way to go, I'm fine with that, too. Hope the problem is clear. Any help would be most appreciated! |
#2
|
|||
|
|||
Try the following wildcard Find/Replace:
Find=[0-9]{1,}\. Replace=Example ^& |
#3
|
|||
|
|||
Robert2 - thank you for your help. Interestingly, your strings resulted in exactly the same as my first version, e.g.: "Exampl1.e An apple". Because I expect you know what you're talking about, I figured that something fundamental must be wrong at my end. And I've figured out the culprit - it's track changes. Both your version and mine work fine when track changes is OFF. Track changes causes this problem whether or not deletions are shown or hidden. I can't figure out why track changes would cause this problem, but it's solved, so thank you for taking the time to help.
-Paul |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wildcard find/replace wildcard question | hephalumph | Word | 1 | 03-12-2022 12:54 AM |
Need Help With Find and Replace Wildcard | rsrasc | Word VBA | 9 | 10-13-2015 02:37 PM |
Find-replace using part of what was found in the replacement text | paulkaye | Word | 3 | 12-22-2014 02:52 AM |
Need help using WildCard Find & Replace | Cayce | Word | 1 | 06-09-2014 04:17 PM |
Bad view when using Find and Find & Replace - Word places found string on top line | paulkaye | Word | 4 | 12-06-2011 11:05 PM |