h1

Word: Replace excess spaces

January 11, 2009

You can use Word’s ‘wildcard’ feature to find and replace excess spaces in a document. You might have inherited a document that has two, three, five spaces separating words (or some other variation). You want to remove all these excess spaces and get back to one space.

You can do this the long way by doing multiple passes using Find and Replace, but there’s a much quicker way using a wildcard search.

Replacing excess spaces using wildcards in Find and Replace

  1. Open Find and Replace (Ctrl+H).
  2. Click the More button to expand the window, then select the Use Wildcards check box.
  3. In the Find what field, type: space[space]@([!space]) (substituting the word ‘space’ with an actual space).
  4. In the Replace with field, type: space\1 (again, substitute the word ‘space’ with an actual space).
  5. Click Replace All.

Replacing excess spaces the long way using multiple passes with Find and Replace

If you can’t remember wildcard commands (I can’t!), then you can still do this fairly quickly using Find and Replace:

  1. Open Find and Replace (Ctrl+H).
  2. Press the spacebar four times in the Find what field. (Why four? well, if you have five or more, four will still find them.)
  3. Press the spacebar once in the Replace with field.
  4. Click Replace All.
  5. Go back to the Find what field and delete one of the spaces (there should be three left). Leave the Replace with field as it is.
  6. Click Replace All.
  7. Go back to the Find what field and delete one of the spaces (there should be two left now). Leave the Replace with field as it is.
  8. Click Replace All. If you don’t get a zero result, click Replace All again to get the last of them.

See also:

[Links last checked January 2012]

11 comments

  1. […] Using wildcards in find/replace to remove multiple excess spaces: https://cybertext.wordpress.com/2009/01/11/word-replace-excess-spaces/ […]


  2. You can also use ^w in the Find what and a single space in the Replace with. Note that the ^w looks for “any white space” and will convert tabs as well, so if that will cause a problem, either use the methods described or convert the tabs first (^t finds a tab).


  3. […] Another wildcard method, plus the multiple pass method: https://cybertext.wordpress.com/2009/01/11/word-replace-excess-spaces/ […]


  4. Wow! This is Awesome! Huge time saver….

    Thank you!!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: