h1

Word: Change the spaces after a period

January 23, 2009

Here was my problem as I described it to the Microsoft Office Discussion Group:

I have a long document that several authors have worked on. Some use two spaces after the period, some one. The corporate style is two (not my decision!), so I’m trying to figure out an easy way of finding ALL instances of only one space after a period and replacing it with two spaces. Sounds easy? Nope.

Problem is that each sentence following the space starts with a different letter. I want to be able to find “.<space>[A-Z]” and replace with “.<space><space>[A-Z]” where [A-Z] is any capital letter. The original letter must be replaced with itself.

I can do this one letter at a time (e.g. “.<space>A” replace with “.<space><space>A” but as I know there will be many documents like this, I’d like to know if there’s a simple way to automate the process, either using wildcards, special characters, or a macro.

Oh, and adding a minor complication to this — I don’t want to do a ‘Replace All’ as some legitimate periods are followed correctly by a single space (for example, in the list of References, or after “i.e.” or “e.g.”).

Does anyone have any idea as to how I can achieve this? I’m happy to click Replace for each instance found, but I really don’t want to set up 26 different find/replace sequences to hit all letters of the alphabet.

Within two hours I had two responses, both of which offered a different method to achieve what I wanted. I tested them and both solutions work well.

Brian’s solution

Try Find ‘period space space’ and replace with ‘period space’ to get them all the same, then find ‘period space’ and replace with ‘period space space’.

You can then search on ‘i.spacespace e.space space’ and replace with ‘i.e.space’. Do the same for e.g.

Graham’s solution

With the wildcard option set Find what to (.) ([A-Z]) and Replace with \1  \2

(NOTE: There are TWO spaces between \1 and \2.)

Watch out…

There are a few things to watch out for.

  • If you have a list of references written like Smith, JA. 2010. two spaces will get added after the A. and the 2010. To avoid this, select only the sections of the document you want to check and don’t select your References list.
  • If you have citations written like (Smith. 2010), two spaces will get added after Smith.
  • Abbreviations with periods like e.g., i.e., and etc. will all get changed. You’ll need to run a separate find/replace to change them back.

Update 18 February 2009: I have now used Graham’s solution many times over — and it has saved me hours of work. It’s a winner!

Update 31 July 2009: Seems the latest APA Publication Manual is now recommending two spaces after a period, even in HTML pages (which will require the use of the non-breaking space [ ]). Some details here: http://spacewaste.wordpress.com/

45 comments

  1. OMG, you are genius who just saved me from throwing away my laptap (I was close) I automatically type two spaces, but APA format calls for one. Thank you thank you!!


  2. Glad it helped! But I’m not the genius — the two people who posted the answer on the Microsoft Word forum are. Brian’s solution I already knew but it may require several passes over the document to pick up all instances; Graham’s solution just works like a charm for me!


  3. I could not get this to work in my Word 2003.
    I can’t help typing with two spaces and need a solution before I pass on my documents.


  4. Hi Jodie

    Graham’s solution works every time for me in Word 2003, but you MUST have the Use Wildcards check box turned on otherwise it will look for the actual text you typed in (click the More button to see the Use Wilcards check box). You must also make sure there are TWO spaces between the ‘1’ and the following ‘\’ in the Replace with line. You can copy the text for the find and replace parts from this blog post if you’re not 100% sure you’ll get it right.

    And did you know that you can set Word to replace all your two spaces with one — as you type? This means that for future documents you shouldn’t have to use this workaround. You can set the ‘replace two spaces with one’ option in Word 2003 under Tools > Options > Spelling and Grammar tab > Settings button, then set the Spaces required between sentences to ‘1’. For all typing you do after you change this setting, Word will replace your two spaces with one. It won’t break your habit, but it means you don’t have to worry about it again.


  5. Speaking of switching from 2 spaces to 1, be aware that APA has now reverted back to 2 spaces at the end of sentences in it’s new 6th edition of their publication manual. See http://spacewaste.wordpress.com/ for more info on this.


  6. Thanks Dan. The spacewaste people linked to this blog post a couple of weeks ago and I updated this post on July 31 to mention that new APA ‘rule’. I also tweeted about it — there was a bit of retweeting in the technical writing community, with most disagreeing with the decision. But then, many tech writers don’t use APA as their style guide, so it really doesn’t affect them too much.

    Also, the APA recommendation of two spaces appears to be for manuscripts only.


  7. Does this work with Windows Vista? I’ve been trying for a while and it’s not taking at all. Help! I’m editing a book and this will make my job so much easier if I can figure it out!


  8. HI Audrey

    I just checked Graham’s solution in Word 2007 on a Vista Ultimate 64-bit system, and it worked fine. As I mentioned in an earlier comment to Jodie, make sure the Use Wildcards option is turned on and make sure you put TWO spaces between the \1 and \2 bits in the replace field.


  9. Hi,

    Just a small note: Graham’s solution is used change the number of spaces after the period from 1 to 2. If you need to do the opposite (replace 2 spaces with only 1 after the period, use the following wildcards: in the Find what: (.) ([A-Z]); and in the Replace with: \1 \2.


  10. Thank you for this post. This will help me to “convert” documents for school to the new 2-space APA format. It amazes me that although we have taught for 20 years to space once after a sentence, professional writers and publishers space once AND we made the transition from a typewriter’s monospacing to the proportionate text of a word processor, that such a change would be proposed. So, now we single space for the internet and HTML code (recognizes only one space) and perhaps informal documents and double space on formal documents. Hmm.


  11. hi, a question.. for the reference list between intials between authors is one space but when i do the wildcard for the spacing two after every period how do i set it up for that one without ruining the two space for the new apa 6th edition.


  12. Why not just select the area you want to apply the change to?


  13. on ways to quickly change two spaces after a period to one in Word 2007. I’ve figured out two methods to do this:

    The manual (easier, slower) method:

     Click the “office button” (top-left corner)
     At the bottom, click on “Word Options”
     Click the “Proofing” tab on the left
     Towards the bottom, click on the “Settings…” button next to “Writing Style:”
     Under the “Require” heading, change “Spaces required between sentences” to “1”

    This will add a green squiggly line whenever you use (or have used) two spaces. However, you will have to go through and change each one individually.

    The automatic (harder, faster) method:

     Save your file (just in case)
     Press Ctrl+F to open the “Find and Replace” window
     Click the “More > >” button in the bottom-left corner
     Check the “Use Wildcards” box (this allows you to use ‘regular expressions’ which use symbols to represent words and punctuation)
     Under “Find what:” type “(?) ([A-Z])” with two spaces in between (do not include the quotation marks)
     Under “Relace with:” type “\1 \2” with one space in between (do not include the quotation marks).
     Test it out once, manually clicking “Find Next” and then “Replace”
     If you have an extra space many times, you can simply click the “Replace All” button


  14. Thanks Michael. I’ve never had a problem with reducing from two to one space; it was increasing from one to two that was the issue.

    My solution for reducing from two to one is to just do a Find/Replace for two and replace with one:
    1. Ctrl+H to open the Find/Replace window.
    2. Type two spaces in the Find field.
    3. Type one space in the Replace field.
    4. Click Replace All.
    5. Repeat step 5 (sometimes writers might use 3 or more spaces — by repeating the action a couple of times until you get a result of 0 replacements, you’ll get them all).


  15. When I used this fix, I ended up with no space between the period and the first letter of the next sentence, and then 2 spaces after that first letter and before the second letter. Help!


  16. Hi Jennifer

    I’ve seen that happen once. I’m not sure what caused it. What I did was immediately undo the changes (alternative: Don’t save until you know it’s right). I then redid the command (copy/paste from this blog post if you find that easier). Make sure you have that Wildcards checkbox checked.

    –Rhonda


  17. […] Change one space after a period to two […]


  18. Thanks for this post – I have a devil of a time getting our support staff to put two periods after a space, and this tip makes my editing so much easier.


  19. Graham’s solution works well but it misses ? and ! that finish sentences.

    Any solution to that?


  20. Hi John

    Have you tried Graham’s solution but this time with (?) or (!) instead of (.)?? That *should* work, though I haven’t tried it myself.

    –Rhonda


  21. The behavior mentioned by Jennifer happened to me too. I had Word’s tracking changes feature turned on. Turning it off, the solution worked again.

    Don’t know if that helps everyone, but it helped me.

    I guess something in the tracking changes interferes somehow. Uncertain why it should make a difference.


  22. […] Change the spaces after a period from one to two: https://cybertext.wordpress.com/2009/01/23/word-change-the-spaces-after-a-period/ […]


  23. Thanks Graham! Worked perfectly and was very easy.


  24. I like the above solutions, but there’s another option for those who prefer to hit the space tab once after they entered a period and have the cursor jump two space. Not my idea, found it somewhere a long time ago, can’t find the source anymore.

    Click the Office button/ click on Word Options/ Select Proofing/ click on Auto Correct Options/ where it says Replace Text as you type click the Replace box and type . (i.e., just 1 period), and in the With box type . (i.e., 1 period followed by 2 spaces- clicks on the space bar). Okay all windows by clicking on the add button, followed by OK twice.

    cheers,
    CGC


  25. I don’t usually write comments, but I had to leave one on this page. The group of you have saved me HOURS of work with finding and replacing spaces after periods, etc. THANK YOU!!!!


  26. Graham’s solution

    Thank you for this tip. I edit a journal, and still get articles using APA 5 that are single spaced. This has saved me SO much time formatting.

    Heather


  27. Thank you so much! I finished writing my first publication article for grad school only to find out that I needed two spaces instead of one. This saved me hours of time editing a 30 page paper!


  28. I have used Graham’s solution and Brian’s and they don’t seem to work in my word 2003. I am using a current document and I want to change from 2 spaces after a period to one. I go to edit then replace and type in as suggested and it tells me the search item is not found or when I click replace all it says there are o replacements but still 2 spaces. I have checked wildcards box. I am not sure why it is not working on a current document. Can someone help me with this?
    I have followed Rhonda’s advice for future documents I have gone to tools, options, spell and grammar and changed from 2 spaces to 1 space. Why do I still have to hit the space bar once? It sounds as if it would go one space automatically.


  29. Excellent! A few people out there have solutions that absolutely don’t work. Yours absolutely does! Thank you!


  30. I have a 450 page manuscript with 2 spaces after every period, because I use APA for my doctoral class for 3 years. But the book is supposed to be formatted in Chicago 16- I freaked when I found out! Literally started to cry, I’ve been through he!! with this book, including the “blue screen of death” a few weeks ago. My work is due next week to the editor – I wasn’t even going to try the search and replace method, I just thought it wouldn’t work, but it did. Thanks!!! Yay!!!


  31. I wrote a macro based on this thread and other online discussion.

    Sub TwoSpaces()

    ‘ Automatically replace one or three spaces with two space between two sentences
    ‘ if the first sentence ends with period, question mark or exclamation mark

    ‘Replace one space with two spaces
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “([.\?\!]) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘Replace three space with two spaces
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “([.\?\!]) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘Replace sentences ending with double quote (ASCII code 34 or repeating the double quote)
    ‘ or right double quote (ASCII 148)
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “([.””\?””\!””\.” & Chr(148) & “\?” & Chr(148) & “\!” & Chr(148) & “]) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘Replace three spaces with two spaces
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “([.””\?””\!””\.” & Chr(148) & “\?” & Chr(148) & “\!” & Chr(148) & “]) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘Exception: Fig. X
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “(Fig.) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘ Exception: A vs. B
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “(vs.) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ‘Exception: A Vs. B
    ‘Other exceptions can be added
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = “(Vs.) ([A-Z])”
    .Replacement.Text = “\1 \2”
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    End Sub


  32. The website automatically removed extra spaces between my post. In order for the code to work as intended, you must use the correct number of spaces before ([A-Z]) and one space between “\1 \2”.


  33. I also posted the macro on dropbox. Hope that helps. https://dl.dropbox.com/u/61567401/DoubleSpace.txt


  34. Thanks for sharing, Feng!


  35. An impressive share! I’ve just forwarded this onto a co-worker who had been doing a little research on this. And he actually ordered me lunch because I stumbled upon it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanks for spending the time to discuss this topic here on your blog.


  36. Hi Paula

    Glad he bought you some lunch! He could buy me lunch too by clicking the Donate button ;-)

    –Rhonda


  37. Hi, This doesn’t work for me. It find the correct string, e.g. “. T” in “. The” but replaces it with “.T He” So it is removing the space between “.” and “T” and putting 2 spaces after the “T” . I’ve checked and the solution works for Word 2003 but not for Word 2010 that I am currently using…


  38. Hi Garret

    If you’re getting no spaces between the period and the first capital, and a space after it, then you may have entered the ‘Replace with’ incorrectly. The pattern your result gives you follows the \1\2 pattern, whereas you need to specify this pattern: \1\2.

    –Rhonda


  39. Hi Rhonda,

    I know the replace pattern is correctly specified because when I try exactly the same Find/Replace patterns in a NEW Word 2010 document, Find/Replace works as it should. But when I try the exact same Find/Replace pattern in an existing file, I get the anomalous behaviour described in my post.

    So it is odd behaviour, to say the least.

    -Garret


  40. Any advice on Word 2013? the basic (.) ([A-Z]) doesn’t work.


  41. Hi Smatassa

    I’m surprised it doesn’t work — as far as I know nothing has changed in the Wildcard find/replace stuff in later versions. However, try enclosing the double space in parentheses too — (.)( )(A-Z) — and make sure the Wildcard option is checked.

    –Rhonda


  42. Hi – I’m trying to replace spaces in the following use case “{IF Show Line Manager Name}” so it would render as {IF Show_Line_Manager_Name}.

    Any suggestions ?


  43. Hi Patfong

    This is a tricky one. I only got so far with it before it beat me. However, what I did get might be enough to get you started. Be aware, though, that only the first three words of any of these strings will be changed — you’ll have to change the rest yourself manually, unless anyone else has any bright ideas how to get further than I did.

    1. Use wildcards.
    2. Copy/paste this into the Find: (\{)(IF )()( )()( )()(\})
    3. Copy/paste this into the Replace: \1\2\3_\5_\7\8

    NOTE: You’ll have to modify the Find! WordPress doesn’t like the greater than/less than characters. Each of those parentheses without any characters/spaces in them needs to have inside it a greater than symbol, followed by an asterisk, followed by a less than symbol.

    When I tried to add more words, it didn’t work—I think because the Replace doesn’t like numbers greater than 9.

    –Rhonda



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: