Reply
 
Thread Tools Display Modes
  #1   Report Post  
AzmL AzmL is offline
Junior Member
 
Posts: 0
Default [SOLVED] Wildcard and placeholders

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 06:30 PM
  #2   Report Post  
AzmL AzmL is offline
Junior Member
 
Posts: 0
Default

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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Wildcard and placeholders

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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Wildcard and placeholders

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   Report Post  
AzmL AzmL is offline
Junior Member
 
Posts: 0
Default

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   Report Post  
AzmL AzmL is offline
Junior Member
 
Posts: 0
Thumbs up

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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Wildcard and placeholders

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   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill[_3_] Suzanne S. Barnhill[_3_] is offline
external usenet poster
 
Posts: 52
Default Wildcard and placeholders

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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Wildcard and placeholders

"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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Picture Placeholders redshift Microsoft Word Help 3 June 15th 08 08:37 PM
Placeholders in Templates Don Bouchard New Users 2 April 15th 08 08:12 AM
placeholders David G Microsoft Word Help 1 November 16th 06 01:59 AM
How do I set up placeholders? anitron Microsoft Word Help 3 May 26th 06 02:52 PM
Placeholders for graphics? Jauchart Tables 2 March 4th 06 04:26 AM


All times are GMT +1. The time now is 09:32 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"