Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Replacing Multiple Spaces with Tabs.

Replacing Multiple Spaces with Tabs

by Allen Wyatt
(last updated February 15, 2020)

10

You may receive a document from someone that uses multiple spaces to separate items on a line. This is typically done when a person wants to format tabular material, and separates columns using spaces. You can find this quite a bit in information downloaded from the Web.

If you are starting with a source document in this condition, you may be wondering how you can replace all the consecutive spaces with a single tab character. It is possible to go through multiple search-and-replace operations to achieve the desired goal, but there is a quicker way. You can replace any number of consecutive spaces with a single tab character by following these steps:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click on the More button if it is available. (See Figure 1.)
  3. Figure 1. The Replace tab of the Find and Replace dialog box.

  4. In the Find What box, enter a single space followed by the characters {2,}. (Type only the left brace, the number 2, the comma, and the right brace.)
  5. In the Replace With box, type ^t.
  6. Make sure the Use Wildcards check box is selected.
  7. Click on Replace All.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12741) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Replacing Multiple Spaces with Tabs.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Scanning and Fixing System Files

Is your system running a bit flakey at times? If you think the culprit might be a problem with some of your system files, ...

Discover More

Resizing a Text Box in a Macro

Text boxes are easy to add to a worksheet and manually resize, as needed. If you want to resize the text box in a macro, ...

Discover More

Adjusting Row Height for a Number of Worksheets

Adjusting the height of a row or range of rows is relatively easy in Excel. How do you adjust the height of those same ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Finding and Replacing Text Boxes

The Find and Replace capabilities of Word are very powerful, but they still come up a bit short when searching for some ...

Discover More

Pay Attention to Case when Searching for ASCII Codes

Word allows you to search for specific ASCII codes in a document. If you use codes to search for alphabetic characters, ...

Discover More

Replacing with Plain Text

When using Find and Replace, how your replacements are formatted will depend on how the text being replaced is formatted. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 2?

2022-01-05 07:37:47

Krasimir Paskulov

Allen,
It obviously doesn't have anything to do with the word version, but with Regional settings, rather.
List separator - it's ; here.


2022-01-05 05:11:51

Krasimir Paskulov

Allen,
Hahaha, I wish I could take back my previous message.
I tried one more time with space+{2;} instead of {2,}, and this time it worked. For some reason this is the correct function to use in my version of word. Otherwise, in the Special pop-up menu, one sees still {,}, but word actually inserts {;}, and it's the correct thing to use in my case.

Hope this might be of help to someone.

[My version is the last one: Word 2003 (11.8411.8405) SP3]

Thank you.


2022-01-05 05:04:14

Krasimir Paskulov

Allen,
Thank you for your time and effort.
I highly appreciate it, as you've helped me and many other people around the world use word in a much better way.
I followed your last suggestions, there was a slight difference in step 5, there, when I click on "Num Occurrences", word inserted {;} instead of {,}, I tried with both, getting the same result - The Find What text contains a Pattern Match expression which is not valid.
I don't think I have any limitations in word, I have the full registered version.
I have used the wildcards option in the find and replace dialog many many times, using successfully also the same curly braces, only in this case they don't work for some reason.
Obviously it just wasn't meant to be :)
Thank you


2022-01-04 08:56:49

Allen

Krasimir,

Thanks for providing the link to the screen shot. (That was helpful.)

I'm not sure why you are getting the results you are, as I cannot reproduce them. I get exactly what the tip says I should get--the replacements. You do, however, provide a few clues which can be followed.

Here is what I would try, since you are seeing the message that the problem is with the Find What box.

1. Make sure the Use Wildcards check box is selected.
2. Clear out the Find What box. Make sure it is empty, but put the insertion point within it.
3. Type a single sapce.
4. Click Special, at the bottom of the dialog box. You'll see a bunch of options appear.
5. Choose the "Num Occurrences" option. Word inserts a pair of braces surrounding a comma, like this: {,}
6. Just before the comma, type the number 2.
7. Make sure ^t is in the Replace With box.
8. Click Replace All.

If, after step 5, you don't see the curly braces appear, then the only thing I can conclude is that there is some limitation or variation based on your version of Word.


2022-01-04 05:38:49

Krasimir Paskulov

I'm following strictly what's written in https://word.tips.net/T000851_Replacing_Multiple_Spaces_with_Tabs

The space before the {2,} is NOT missing, and BOTH of the curly brackets are CURLY bracket, as instructed in https://word.tips.net/T000851_Replacing_Multiple_Spaces_with_Tabs (and many other posts, by the way).
I've copied and pasted the content, I'm sure there's nothing wrong that I'm doing, that's why I decided to bother you for some advice.

Here's exactly what I do:
To avoid other influencing factors, I open a new word document, I type several spaces, I type 123, then I type some more spaces.
Ctrl+H,
I type " {2,}" (without the quotation marks, of course) in Find What:
I type ^t in Replace With:
I hit Replace All, or Find Next and I always get the same error message:
The Find What text contains a Pattern Match expression which is not valid.

Here's the link to the picture illustrating the situation:
http://krasitrad.com/box/ReplMultSpWithTabs.jpg

Thanks for you time.


2022-01-04 04:14:14

Ken

Krasimir,

Either the space before the {2,} is missing or one or both of the curly brackets is as straight bracket.


2022-01-04 03:59:37

Alan Elston

Hi Krasimir Paskulov
I am not sure of the answer to yout questions, but did you check here......
.....
https://word.tips.net/T000851_Replacing_Multiple_Spaces_with_Tabs
.....
That is tips from Allen Wyatt for Word 2003 ( Word tips net )


2022-01-03 11:28:54

Krasimir Paskulov

Hi,
Can you explain to me why this trick is not working in my word 2003?
I did exactly as instructed.
Here is the result:

{2,} -> The Find What text contains a Pattern Match expression which is not valid.

Thank you.


2020-02-17 14:17:13

Jay

It appears that for us troglodytes that use two spaces between sentences, {3,} would be more appropriate.


2020-02-17 11:53:50

Bill

"enter a single space followed by the characters {2,}"

can you give an explanation of [2,] ?

It would be helpful to know so I can modify this suggestion to other situations.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.