Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi there,
I am doing a find and replace exercise using wildcards. I have MS Office Professional 2010. I want to replace "Section X" by "Chapter X" (X being a number from 0 to 9) Here is what I have inputed into the Find and Replace box: Find what: Section ([0-9]) Replace with: Chapter \1 Curiously, "Section X" is replaced by "X Chapter" (the number appears BEFORE Chapter). Is this a bug? I have been using wildcard several times and never faced such a behaviour. Many thanks Last edited by AzmL : February 14th 13 at 05:30 PM |
#2
![]() |
|||
|
|||
![]()
Update:
If I create a new word document, with fake text and some "Section X", then it works as I am looking for. But when I switch to the document I want to work on, then the problem is back. I use styles and numbering in my document (not in the fake one) Any tracks? Cheers! |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Try the following instead:
"Find what": (Section )([0-9]) "Replace with": (Chapter )\2 -- Stefan Blom Microsoft Word MVP "AzmL" wrote in message ... Hi there, I am doing a find and replace exercise using wildcards. I have MS Office Professional 2010. I want to replace "Section X" by "Chapter X" (X being a number from 0 to 9) Here is what I have inputed into the Find and Replace box: Find what: Section ([0-9]) Replace with: Chapter \1 Curiously, "Section X" is replaced by "X Chapter" (the number appears BEFORE Chapter). Is this a bug? I have been using wildcard several times and never faced such a behaviour. Many thanks -- AzmL |
#4
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Sorry, I made a typo. "Replace with" should be:
Chapter \2 (note that there is a space before the backslash). -- Stefan Blom Microsoft Word MVP "Stefan Blom" wrote in message ... Try the following instead: "Find what": (Section )([0-9]) "Replace with": (Chapter )\2 -- Stefan Blom Microsoft Word MVP "AzmL" wrote in message ... Hi there, I am doing a find and replace exercise using wildcards. I have MS Office Professional 2010. I want to replace "Section X" by "Chapter X" (X being a number from 0 to 9) Here is what I have inputed into the Find and Replace box: Find what: Section ([0-9]) Replace with: Chapter \1 Curiously, "Section X" is replaced by "X Chapter" (the number appears BEFORE Chapter). Is this a bug? I have been using wildcard several times and never faced such a behaviour. Many thanks -- AzmL |
#5
![]() |
|||
|
|||
![]()
Hi Stefan,
Thank you for your help. Unfortunately I still get the same bug. I have also tried the following, just to try understanding what is going on: Find What: TXT ([0-9]{1,}) Replace with: helloword \1 Original text: TXT 156 Replaced text: hell156oword Also, it does not pick up all the TXT ### instances (### are 3 digits) All of this looks extremely random I am very confused. |
#6
![]() |
|||
|
|||
![]()
I eventually sorted the problem.
Track changes were activated, but even if I was displaying the Final version (with no comments), the search and repalce function was dealing with the combination of the original and final strings together. If anyone faced the same issue, you simply have to deactivate the Track changes. If you activate track changes and display deletion inline with insertions, this is what you get: Before replace: Section 2 After replace: [Section ]2[2]Chapter [brackets are for the deleted text] |
#7
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Sorry, wildcard searches are tricky. :-(
"Find what": (Section )([0-9]{1,}) "Replace with": Chapter \2 Note that {1, } is for English systems. If your list separator (in Control Panel) is a semi-colon, use that instead. This should match all occurrences of Section, followed by a space, followed by a number with one digit or more, and the replacement is Chapter followed by a space followed by the found number. Remember to select "Use wildcards" in the Find and Replace dialog box. Note that I'm assuming here that the text and the numbers were typed in. If auto numbering has been used, the find and replace will fail. -- Stefan Blom Microsoft Word MVP "AzmL" wrote in message ... Hi Stefan, Thank you for your help. Unfortunately I still get the same bug. I have also tried the following, just to try understanding what is going on: Find What: TXT ([0-9]{1,}) Replace with: helloword \1 Original text: TXT 156 Replaced text: hell156oword Also, it does not pick up all the TXT ### instances (### are 3 digits) All of this looks extremely random I am very confused. -- AzmL |
#8
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Assuming that you have used a specific style for your section/chapter
headings, just search for "Section" and replace with "Chapter." With the insertion point in the "Find what" box, click More to expand the Replace dialog. Check the box for "Match case," and then click Format and choose Style. Select the style used for your headings, and click OK. Replace All. If you had used auto numbering for these headings, you would only have to modify the number format in the Multilevel List dialog. "AzmL" wrote in message ... Hi there, I am doing a find and replace exercise using wildcards. I have MS Office Professional 2010. I want to replace "Section X" by "Chapter X" (X being a number from 0 to 9) Here is what I have inputed into the Find and Replace box: Find what: Section ([0-9]) Replace with: Chapter \1 Curiously, "Section X" is replaced by "X Chapter" (the number appears BEFORE Chapter). Is this a bug? I have been using wildcard several times and never faced such a behaviour. Many thanks -- AzmL |
#9
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
"Suzanne S. Barnhill" wrote in message
... Assuming that you have used a specific style for your section/chapter headings, just search for "Section" and replace with "Chapter." With the insertion point in the "Find what" box, click More to expand the Replace dialog. Check the box for "Match case," and then click Format and choose Style. Select the style used for your headings, and click OK. Replace All. I have to admit I'm a bit embarrassed, for not thinking of the most obvious way to do this... -- Stefan Blom Microsoft Word MVP |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Picture Placeholders | Microsoft Word Help | |||
Placeholders in Templates | New Users | |||
placeholders | Microsoft Word Help | |||
How do I set up placeholders? | Microsoft Word Help | |||
Placeholders for graphics? | Tables |