What are the gotchas?

I

Island Girl

I just tried what seems to me like a too-simple way to replace two or more
spaces after a word or the end of a sentence, and that is to search for white
space (^w) and replace with one space by just pressing the space bar once in
the replace box.

It seems too good to be true, so before I adopt this approach, please tell
me what could go wrong, assuming the material is just regular paragraphs of
text.

Thanks!
 
J

Jay Freedman

I just tried what seems to me like a too-simple way to replace two or more
spaces after a word or the end of a sentence, and that is to search for white
space (^w) and replace with one space by just pressing the space bar once in
the replace box.

It seems too good to be true, so before I adopt this approach, please tell
me what could go wrong, assuming the material is just regular paragraphs of
text.

Thanks!

The only thing that occurs to me is this: the white space code ^w matches both
spaces and tab characters. So if your document contains one or more tabs and
spaces together, in any order, then the replacement will turn that into a single
space. If you were counting on the tabs to align text, you won't get that effect
any more.

If you want to be sure you're changing only occurrences of multiple spaces,
click the More button and check the box for "Use wildcards". Then use the search
term

[ ]{2,}

(with a space between the brackets) and replace with a single space character.
 
I

Island Girl

I hadn't thought of that, Jay. I always value your input and will certainly
take your suggestion. Thanks!

Jay Freedman said:
I just tried what seems to me like a too-simple way to replace two or more
spaces after a word or the end of a sentence, and that is to search for white
space (^w) and replace with one space by just pressing the space bar once in
the replace box.

It seems too good to be true, so before I adopt this approach, please tell
me what could go wrong, assuming the material is just regular paragraphs of
text.

Thanks!

The only thing that occurs to me is this: the white space code ^w matches both
spaces and tab characters. So if your document contains one or more tabs and
spaces together, in any order, then the replacement will turn that into a single
space. If you were counting on the tabs to align text, you won't get that effect
any more.

If you want to be sure you're changing only occurrences of multiple spaces,
click the More button and check the box for "Use wildcards". Then use the search
term

[ ]{2,}

(with a space between the brackets) and replace with a single space character.


--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top