Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
alexw alexw is offline
external usenet poster
 
Posts: 3
Default Word 2003: Advanced Find & Replace Broken? (long post)

Hi,

I am not a new user, but I couldn't find a suitable group for this, so
I posted it here.
I'm experiencing strange behaviour with Word's (2003 SP3) Advanced
Find & Replace w/ the "Use wildcards" option.

What I'm trying to do:
Find all paragraphs consisting only of numbers, add a prefix to the
number and replace the closing paragraph mark with a whitespace.
This is to move recitals (marginal numbers) to the beginning of the
related paragraph.

The first problem I encountered was with search (this is w/ a .txt
file made from the original .doc, so the recitals become regular
paragraphs w/ only the number in them).
Searching for paragraph marks with ^13 works.
Searching for numbers with ([0-9]{1;}) works as well (please note that
this is a German localized system, so ';' is indeed correct).
Combining both to ^13([0-9]{1;})^13 doesn't work. It finds none of the
targets and 'finds' several completely wrong numbers w/ no paragraph
marks next to them.
Neither do ([0-9]{1;})^13 or ^13([0-9]{1;}) work.

So far, the description was for a .txt file.

After the attempts described above not working, I moved to the actual
incoming .doc file, which has the recitals formatted with a special
paragraph style and a positioning frame (btw, I'm not sure whether I
use the correct English expressions because, unfortunately, I'm forced
to use a localized German version of Word).

Removing the positioning frame is easy. I can also easily replace the
paragraph marks by spaces when searching w/ the style required.
What goes wrong completely, is trying to add the prefix to the recital
numbers. The behaviour is *very* strange.
When I try to add the prefix to the expression itself, it is
- added completely *after* the number (expression) instead of being
prepended if the prefix is one or two letters;
- added in part before the number and after the number, if the prefix
is three or more letters, w/ less letters added before the number and
more letters added after the number if the number of digits goes up.

This behaviour occurs both w/ and w/o the "Use wildcards" option ("\1"
and "^&", resp., with the prefix added correctly before them in the
"replace" field).

To me, this looks like broken code/a bug. Almost posted this
in .applicationerrors, but that one looks more like a developers
forum.

Any ideas?

--
Alex
  #2   Report Post  
Posted to microsoft.public.word.newusers
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Word 2003: Advanced Find & Replace Broken? (long post)

You should be searching for

([0-9]{1;})^13

and replace with

prefix\1[space]

where you replace prefix with the prefix that you want to use and you press
the spacebar in place of [space]

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"alexw" wrote in message
...
Hi,

I am not a new user, but I couldn't find a suitable group for this, so
I posted it here.
I'm experiencing strange behaviour with Word's (2003 SP3) Advanced
Find & Replace w/ the "Use wildcards" option.

What I'm trying to do:
Find all paragraphs consisting only of numbers, add a prefix to the
number and replace the closing paragraph mark with a whitespace.
This is to move recitals (marginal numbers) to the beginning of the
related paragraph.

The first problem I encountered was with search (this is w/ a .txt
file made from the original .doc, so the recitals become regular
paragraphs w/ only the number in them).
Searching for paragraph marks with ^13 works.
Searching for numbers with ([0-9]{1;}) works as well (please note that
this is a German localized system, so ';' is indeed correct).
Combining both to ^13([0-9]{1;})^13 doesn't work. It finds none of the
targets and 'finds' several completely wrong numbers w/ no paragraph
marks next to them.
Neither do ([0-9]{1;})^13 or ^13([0-9]{1;}) work.

So far, the description was for a .txt file.

After the attempts described above not working, I moved to the actual
incoming .doc file, which has the recitals formatted with a special
paragraph style and a positioning frame (btw, I'm not sure whether I
use the correct English expressions because, unfortunately, I'm forced
to use a localized German version of Word).

Removing the positioning frame is easy. I can also easily replace the
paragraph marks by spaces when searching w/ the style required.
What goes wrong completely, is trying to add the prefix to the recital
numbers. The behaviour is *very* strange.
When I try to add the prefix to the expression itself, it is
- added completely *after* the number (expression) instead of being
prepended if the prefix is one or two letters;
- added in part before the number and after the number, if the prefix
is three or more letters, w/ less letters added before the number and
more letters added after the number if the number of digits goes up.

This behaviour occurs both w/ and w/o the "Use wildcards" option ("\1"
and "^&", resp., with the prefix added correctly before them in the
"replace" field).

To me, this looks like broken code/a bug. Almost posted this
in .applicationerrors, but that one looks more like a developers
forum.

Any ideas?

--
Alex



  #3   Report Post  
Posted to microsoft.public.word.newusers
alexw alexw is offline
external usenet poster
 
Posts: 3
Default Word 2003: Advanced Find & Replace Broken? (long post)

On Jul 8, 6:30*am, "Doug Robbins - Word MVP"
wrote:
You should be searching for
([0-9]{1;})^13
and replace with
prefix\1[space]
where you replace prefix with the prefix that you want to use and you press
the spacebar in place of [space]


Haven't been back to this thread for a while because I solved the
problem in a completely different way, but for the record:
I *did* search for ([0-9]{1;})^13, I wrote that. But Word did not find
anything until I did "replace" all ^13 with ^13 (!). Then the search
worked. Go figure.
However, Replace did not. It kept adding characters at the end of the
number instead of in front.
I saved everything to .txt and used Ultraedit's search/replace which
worked without any problems.
Problem unsolved on the Word side (and I still think this is a huge
bug), but doesn't matter anymore.
  #4   Report Post  
Posted to microsoft.public.word.newusers
PamC via OfficeKB.com PamC via OfficeKB.com is offline
external usenet poster
 
Posts: 582
Default Word 2003: Advanced Find & Replace Broken? (long post)

Wild card replace does not work as expected when track changes is on.

PamC

alexw wrote:
On Jul 8, 6:30Â*am, "Doug Robbins - Word MVP"
wrote:
You should be searching for
([0-9]{1;})^13
and replace with
prefix\1[space]
where you replace prefix with the prefix that you want to use and you press
the spacebar in place of [space]


Haven't been back to this thread for a while because I solved the
problem in a completely different way, but for the record:
I *did* search for ([0-9]{1;})^13, I wrote that. But Word did not find
anything until I did "replace" all ^13 with ^13 (!). Then the search
worked. Go figure.
However, Replace did not. It kept adding characters at the end of the
number instead of in front.
I saved everything to .txt and used Ultraedit's search/replace which
worked without any problems.
Problem unsolved on the Word side (and I still think this is a huge
bug), but doesn't matter anymore.


--
Message posted via http://www.officekb.com

  #5   Report Post  
Posted to microsoft.public.word.newusers
alexw alexw is offline
external usenet poster
 
Posts: 3
Default Word 2003: Advanced Find & Replace Broken? (long post)

On Jul 12, 8:41*pm, "PamC via OfficeKB.com" u43222@uwe wrote:
Wild card replace does not work as expected when track changes is on.


PamC,

thank you so much, you solved the mystery!
Of course, change tracking was on (I never use it myself, but most
documents I get thrown at me have it activated), and this was the
cause of the problem.
However, IMO the expression "does not work as expected" is a little
bit too friendly. In my eyes this *does* qualify as an ugly bug.


  #6   Report Post  
Posted to microsoft.public.word.newusers
PamC via OfficeKB.com PamC via OfficeKB.com is offline
external usenet poster
 
Posts: 582
Default Word 2003: Advanced Find & Replace Broken? (long post)

Yes it does. But it's been there for 3 or 4 years now, maybe longer (& the
heat has gone away from me). It took me several days back then to figure out
why it worked sometimes but not others. Now it's pretty much habit to switch
off track changes and switch to final view before I run any S&R that calls
for switching word order. I haven't even checked to see if the bug is still
there in W2007!

Glad to help,
PamC

alexw wrote:
Wild card replace does not work as expected when track changes is on.


PamC,

thank you so much, you solved the mystery!
Of course, change tracking was on (I never use it myself, but most
documents I get thrown at me have it activated), and this was the
cause of the problem.
However, IMO the expression "does not work as expected" is a little
bit too friendly. In my eyes this *does* qualify as an ugly bug.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/200807/1

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
advanced replace Good Ghost Microsoft Word Help 5 June 8th 07 01:30 PM
Find & Replace in Word 2003 Jackie D Microsoft Word Help 2 January 23rd 06 04:17 PM
How advanced is the "replace" function in Word 2000? Ted Shoemaker Microsoft Word Help 6 July 9th 05 02:17 PM
How advanced is the "replace" function in Word 2000? Ted Shoemaker Formatting Long Documents 6 July 9th 05 02:17 PM
How advanced is the "replace" function in Word 2000? Ted Shoemaker New Users 6 July 9th 05 02:17 PM


All times are GMT +1. The time now is 07:52 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"