Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
I have "inherited" a set of documents that exhibit a rather strange behaviour.
In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Is there a reason not to simply Replace slash with space slash space ?
On May 7, 7:29*am, Johann Swart wrote: I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Yes, there are many other slashes in this document to which this exercise
does not apply. "grammatim" wrote: Is there a reason not to simply Replace slash with space slash space ? On May 7, 7:29 am, Johann Swart wrote: I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
There is a bug (fixed in Word 2007) that causes this to happen when Track
Changes is on. Try switching off Track Changes before your Replace and the turning it back on afterwards. -- Enjoy, Tony www.WordArticles.com "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Hi Johann,
You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Or, for hard spaces in the replacement:
\1^s\2^s\3 -- Cheers macropod [Microsoft MVP - Word] "macropod" wrote in message ... Hi Johann, You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
.. which will still suffer at the hands of the same bug.
-- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Or, for hard spaces in the replacement: \1^s\2^s\3 -- Cheers macropod [Microsoft MVP - Word] "macropod" wrote in message ... Hi Johann, You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect
when a space is inserted between the strings.. -- Cheers macropod [Microsoft MVP - Word] "Tony Jollans" My forename at my surname dot com wrote in message ... .. which will still suffer at the hands of the same bug. -- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Or, for hard spaces in the replacement: \1^s\2^s\3 -- Cheers macropod [Microsoft MVP - Word] "macropod" wrote in message ... Hi Johann, You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Hi TJ, you are 100% correct; I am using TC. And really, I should have guessed
this myself having had similar experiences with TC. I turned TC off and S&R had the desired effect. Thanks a million for reminding me! "Tony Jollans" wrote: There is a bug (fixed in Word 2007) that causes this to happen when Track Changes is on. Try switching off Track Changes before your Replace and the turning it back on afterwards. -- Enjoy, Tony www.WordArticles.com "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
It is not corruption. It is a bug in versions of Word prior to 2007. The
order of replacement literals and found groups is not honoured when Track Changes is in effect. -- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect when a space is inserted between the strings.. -- Cheers macropod [Microsoft MVP - Word] "Tony Jollans" My forename at my surname dot com wrote in message ... .. which will still suffer at the hands of the same bug. -- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Or, for hard spaces in the replacement: \1^s\2^s\3 -- Cheers macropod [Microsoft MVP - Word] "macropod" wrote in message ... Hi Johann, You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#11
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
Ah, I see - I hadn't seen your separate reply to the OP.
Oddly, F/R works correctly when the Find text is itself marked as an addition. Deleted text is left alone if it's hidden, but gets processed (with the same peculiar results you get for previously-unchanged text) if it's visible. -- Cheers macropod [Microsoft MVP - Word] "Tony Jollans" My forename at my surname dot com wrote in message ... It is not corruption. It is a bug in versions of Word prior to 2007. The order of replacement literals and found groups is not honoured when Track Changes is in effect. -- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect when a space is inserted between the strings.. -- Cheers macropod [Microsoft MVP - Word] "Tony Jollans" My forename at my surname dot com wrote in message ... .. which will still suffer at the hands of the same bug. -- Enjoy, Tony www.WordArticles.com "macropod" wrote in message ... Or, for hard spaces in the replacement: \1^s\2^s\3 -- Cheers macropod [Microsoft MVP - Word] "macropod" wrote in message ... Hi Johann, You could perhaps try: ([A-Z]{3})(/)([A-Z]{3}) as the Find, with \1 \2 \3 as the Replace. Note: the and prevent the Find from processing strings of 4 or more letters. -- Cheers macropod [Microsoft MVP - Word] "Johann Swart" wrote in message ... I have "inherited" a set of documents that exhibit a rather strange behaviour. In these documents three-letter codes are listed in the form ABC/DEF. I want to change these to ABC / DEF (i.e. [code][hardspace][forward slash][hardspace][code]). In the Word Search and Replace I select Use Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in the Replace With line \1^s/^s\2. The result is this (surprisingly!): ABCDEF /. When I create a new test document to replicate this situation, the result is as expected, i.e. ABC / DEF. Has anyone ever experienced a situation similar to this? The problem obviously lies with the document itself and not the PC or Word. Has anyone any idea what is going on here and how one can remedy this peculiarity? |
#12
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search and Replace
I'm so glad to hear that it's fixed in W2007. I can't tell you how many
times I've forgotten about that little nuisance and had to undo, turn off track changes, and redo the sort. Pam Tony Jollans wrote: It is not corruption. It is a bug in versions of Word prior to 2007. The order of replacement literals and found groups is not honoured when Track Changes is in effect. Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect when a space is [quoted text clipped - 27 lines] anyone any idea what is going on here and how one can remedy this peculiarity? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ement/200905/1 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Wildcard Search/Replace | Microsoft Word Help | |||
Wildcard search want to replace only a portion of what is found | Microsoft Word Help | |||
Wildcard search for *: | New Users | |||
Can I increment list via wildcard search/replace? | Microsoft Word Help | |||
Help with Wildcard search/replace, please? | Microsoft Word Help |