h1

Word: Find and replace multiple spaces between words

January 6, 2012

Update 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.

  1. Open Word’s Find and Replace dialog box (Ctrl+H).
  2. Click More to show more options.

    Find and Replace dialog - click the More button

    Click More

  3. Select the Use wildcards check box.

    Find and Replace dialog - select Wse Wildcards

    Select Use Wildcards

  4. 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.
  5. In the Replace with field, type: \1
    Note: There’s ONE space immediately after the \1, so make sure you type that too.

    Find and replace dialog - make sure you enter the spaces correctly

    Make sure you enter the spaces correctly

  6. 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:

[Links last checked December 2011]

13 comments

  1. […] […]      by Word: Find and replace multiple spaces between words « CyberText Newsletter January 6, 2012 at 5:31 […]


  2. […] 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 […]


  3. […] Word: Find and replace multiple spaces between words […]


  4. […] […]      by Word: Find and replace multiple spaces between words « CyberText Newsletter January 6, 2012 at 5:31 […]


  5. Super.. Solved my big prob


  6. Thank you! it did help, a lot.


  7. Easy 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.


  8. Hi 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


  9. When 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!


  10. I 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.


  11. The 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



Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.