Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Fuzzhead
 
Posts: n/a
Default Find & Replace Question

I have a bunch of documents that I am trying to do a find and replace on. The
problem is that they have words with various spaces after them and I want to
deleted the spaces and put in an underline. Examples are like the following:

Torque (with 5 spaces)
Torque (with 8 spaces)

And I want it to look like this

Torque _________

Is there a wildcard that will find the spaces?

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default Find & Replace Question

Use the code ^w to find any number of consecutive spaces and tabs. (This
is also available by clicking More and then Special, and choosing "White
Space".) So in the Find What box enter

Torque^w

and in the Replace With box enter

Torque _________

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Fuzzhead wrote:
I have a bunch of documents that I am trying to do a find and replace
on. The problem is that they have words with various spaces after
them and I want to deleted the spaces and put in an underline.
Examples are like the following:

Torque (with 5 spaces)
Torque (with 8 spaces)

And I want it to look like this

Torque _________

Is there a wildcard that will find the spaces?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Fuzzhead
 
Posts: n/a
Default Find & Replace Question

Thanks Jay, that worked when I ran it.

One thing I didn't realize on some of the words is that they are not all the
same. See the follow:

Wrench ID (with spacing)
Wrench ID#(with spacing)
Wrench ID#with spacing)
and so on......

As you can see its in there many different ways. How do I capture all the
variuos ways its in there so I can run the Find & Replace only once?




"Jay Freedman" wrote:

Use the code ^w to find any number of consecutive spaces and tabs. (This
is also available by clicking More and then Special, and choosing "White
Space".) So in the Find What box enter

Torque^w

and in the Replace With box enter

Torque _________

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Fuzzhead wrote:
I have a bunch of documents that I am trying to do a find and replace
on. The problem is that they have words with various spaces after
them and I want to deleted the spaces and put in an underline.
Examples are like the following:

Torque (with 5 spaces)
Torque (with 8 spaces)

And I want it to look like this

Torque _________

Is there a wildcard that will find the spaces?




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default Find & Replace Question

For that you need a real "wildcard" search, as described at
http://www.gmayor.com/replace_using_wildcards.htm. (The ^w code isn't
considered a wildcard in a Word search.)

To make that work, first click the More button and check the box for "Use
wildcards".

You'll have to do this in two passes, because Word's wildcards can express
"one or more of this character" but they can't say "zero or more of this
character". The first pass is a wildcard search for

Find what: [#:b][b]{1,}
Replace with: b_______

(where I used the letter b to represent a blank). Then you'll have to follow
that with a non-wildcard search for

Find what: #b_
Replace with: b_

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Fuzzhead wrote:
Thanks Jay, that worked when I ran it.

One thing I didn't realize on some of the words is that they are not
all the same. See the follow:

Wrench ID (with spacing)
Wrench ID#(with spacing)
Wrench ID#with spacing)
and so on......

As you can see its in there many different ways. How do I capture all
the variuos ways its in there so I can run the Find & Replace only
once?




"Jay Freedman" wrote:

Use the code ^w to find any number of consecutive spaces and tabs.
(This is also available by clicking More and then Special, and
choosing "White Space".) So in the Find What box enter

Torque^w

and in the Replace With box enter

Torque _________

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Fuzzhead wrote:
I have a bunch of documents that I am trying to do a find and
replace on. The problem is that they have words with various spaces
after them and I want to deleted the spaces and put in an underline.
Examples are like the following:

Torque (with 5 spaces)
Torque (with 8 spaces)

And I want it to look like this

Torque _________

Is there a wildcard that will find the spaces?



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Fuzzhead
 
Posts: n/a
Default Find & Replace Question

Thanks that did the job.



"Jay Freedman" wrote:

For that you need a real "wildcard" search, as described at
http://www.gmayor.com/replace_using_wildcards.htm. (The ^w code isn't
considered a wildcard in a Word search.)

To make that work, first click the More button and check the box for "Use
wildcards".

You'll have to do this in two passes, because Word's wildcards can express
"one or more of this character" but they can't say "zero or more of this
character". The first pass is a wildcard search for

Find what: [#:b][b]{1,}
Replace with: b_______

(where I used the letter b to represent a blank). Then you'll have to follow
that with a non-wildcard search for

Find what: #b_
Replace with: b_

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Fuzzhead wrote:
Thanks Jay, that worked when I ran it.

One thing I didn't realize on some of the words is that they are not
all the same. See the follow:

Wrench ID (with spacing)
Wrench ID#(with spacing)
Wrench ID#with spacing)
and so on......

As you can see its in there many different ways. How do I capture all
the variuos ways its in there so I can run the Find & Replace only
once?




"Jay Freedman" wrote:

Use the code ^w to find any number of consecutive spaces and tabs.
(This is also available by clicking More and then Special, and
choosing "White Space".) So in the Find What box enter

Torque^w

and in the Replace With box enter

Torque _________

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Fuzzhead wrote:
I have a bunch of documents that I am trying to do a find and
replace on. The problem is that they have words with various spaces
after them and I want to deleted the spaces and put in an underline.
Examples are like the following:

Torque (with 5 spaces)
Torque (with 8 spaces)

And I want it to look like this

Torque _________

Is there a wildcard that will find the spaces?




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
Find & Replace (replace w/ field)? Not Really Me Microsoft Word Help 4 October 26th 05 04:22 PM
Mega macro with find and replace (HELP!) DKM Microsoft Word Help 1 May 10th 05 06:15 PM
Find and Replace GREEK symbols in XP, 2K & 97 Jazz Microsoft Word Help 3 April 8th 05 08:13 PM
Find & Replace does not find formatting Ed Microsoft Word Help 5 April 1st 05 12:33 AM
Find and Replace Locks Up Word Karine Rivet Formatting Long Documents 1 January 22nd 05 06:21 AM


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