Word: Find and replace multiple spaces between words
January 6, 2012Update March 2019: Although the method below works, there’s a quicker method that uses ^w instead of wildcards. See this blog post for details: https://cybertext.wordpress.com/2019/03/29/word-a-quick-way-to-replace-multiple-spaces-with-a-single-space/
*******
Your document has varying numbers of spaces between words — for example, 2, 3, 4 etc. spaces instead of just one space. You want to be able to find all multiple spaces after any word and replace them with a single space in one Find/Replace action.
NOTE: This find/replace DOES NOT look for multiple spaces in front of numbers, or after punctuation characters — only letters.
Here’s how to do it.
- Open Word’s Find and Replace dialog box (Ctrl+H).
- Click More to show more options.
- Select the Use wildcards check box.
- In the Find what field, type: ([A-Za-z])( {2,9})
Note: There’s ONE space in this text — it’s between the second ( and the {. To be safe, copy the text from Step 4 and paste it into your Find what field. - In the Replace with field, type: \1
Note: There’s ONE space immediately after the \1, so make sure you type that too. - Click Find Next to find the next instance of multiple spaces between words. If the Find is successful and you are confident you’re not going to mess anything up, click Replace All. If you want to check each instance before replacing it, just click Replace then Find Next, Replace until you’ve dealt with them all.
Explanation for how this works:
- ([A-Za-z]) looks for any letters, upper (A-Z) or lower case (a-z). Because you are using wildcards, you need to surround the text you want to find in parentheses. This string defines the first section of the Find.
- ( {2-9}) looks for a space followed by two or more spaces, up to 9 spaces (you can put whatever numbers you like inside the curly braces — if you think you might have some instances of semicolons followed by 15 spaces, then change these numbers to {2-20}, for example. Again, this section is surrounded by parentheses to define it as a separate section.
- \1 replaces the first part of the wildcard string with itself. In other words, the letter found is replaced with itself, so no change apparently occurs.
- The space after \1 replaces the multiple spaces found in the second part of the wildcard string with a single space.
See also:
- https://cybertext.wordpress.com/2010/09/13/word-find-and-replace-any-number-of-spaces/
- https://cybertext.wordpress.com/2009/01/11/word-replace-excess-spaces/
- https://cybertext.wordpress.com/2008/06/28/word-remove-excess-characters/
- https://cybertext.wordpress.com/2012/01/04/word-find-and-replace-multiple-spaces-after-a-punctuation-mark/
- https://cybertext.wordpress.com/2012/01/05/word-find-and-replace-multiple-spaces-before-a-number/
[Links last checked December 2011]
[…] […] by Word: Find and replace multiple spaces between words « CyberText Newsletter January 6, 2012 at 5:31 […]
by Word: Find and replace any number of spaces « CyberText Newsletter January 6, 2012 at 6:48 am[…] specialists « Word: Find and replace multiple spaces after a punctuation mark Word: Find and replace multiple spaces between words » Word: Find and replace multiple spaces before a number January 5, 2012 Your […]
by Word: Find and replace multiple spaces before a number « CyberText Newsletter January 6, 2012 at 6:49 am[…] Word: Find and replace multiple spaces between words […]
by Word: Find and replace multiple spaces after a punctuation mark « CyberText Newsletter January 6, 2012 at 6:50 am[…] https://cybertext.wordpress.com/2012/01/06/word-find-and-replace-multiple-spaces-between-words/ […]
by Word: Replace excess spaces « CyberText Newsletter January 6, 2012 at 6:51 am[…] […] by Word: Find and replace multiple spaces between words « CyberText Newsletter January 6, 2012 at 5:31 […]
by Word: Remove excess characters « CyberText Newsletter January 6, 2012 at 6:52 am[…] https://cybertext.wordpress.com/2012/01/06/word-find-and-replace-multiple-spaces-between-words/ […]
by Word: Insert a space between a number and a letter « CyberText Newsletter February 8, 2012 at 5:30 amSuper.. Solved my big prob
by Petchiammal T October 27, 2012 at 1:56 pmThank you! it did help, a lot.
by Estefania December 7, 2012 at 8:57 amEasy quick fix. In Find What hit the space bar 2 or 3 times (or more if you have many spaces) and in Replace With hit the spacebar once.
by Patti April 5, 2014 at 5:14 amHi Patti
Yes, that technique works well if the number of spaces is consistent. But if you have documents where 8 spaces are used, or 7 or 6, and so on, then you have to do multiple passes to find/replace them all. The method above is for those instances where the number of spaces used is NOT consistent.
–Rhonda
by Rhonda April 7, 2014 at 4:56 pmWhen I initially commented I seem to have clicked the -Notify me when new comments are added- checkbox and
from now on each time a comment is added I get 4 emails with the same
comment. There has to be an easy method you can remove me from that service?
Thanks!
by Britt September 18, 2014 at 4:25 pmI can’t remove you as I can’t see who is on a notification list for any post. Only you can remove yourself through your WordPress.com settings, as far as I am aware.
by Rhonda September 18, 2014 at 5:15 pmThe easy way i found is just to type a double space in find and type a single space on the replace. Its worked for me
by Kuda Chayambuka March 7, 2018 at 7:12 pm