Solved

HT replace period-followed-by-leter with period-space-space-letter? (Word 2010)

Posted on 2012-03-15
6
234 Views
Last Modified: 2012-03-16
I have a huge document that got pasted out of another source.  Many of the sentences have no spaces between the period at the end of one sentence, and the first letter of the first word in the next sentence.  Is there a way to use search & replace to locate them and insert two spaces between the sentences?

Thanks for any help-
0
Comment
Question by:ottenm
  • 2
  • 2
  • 2
6 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37728677
Why don't you simply use a search/replace with

"."
replaced by
".  "
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37728681
Later you might like to replace

".  "
replaced by
".   "
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 37728923
Yes you need at least two Find and Replace operations to be sure of getting two and exactly two spaces.. If you use Wildcards, you can make sure that you are finding a full stop, and not a decimal point.

1 No spaces at the moment
Find:     .([A-Z]{1,})
Replace:  .  \1

Open in new window

2.Some spaces at the moment
Find:     .[ ]{1,}([A-Z]{1,})
Replace:  .  \1

Open in new window


Or you can do it with a VBA macro:
Sub TwoSpaces()
    With ActiveDocument.Range.Find
        .MatchWildcards = True
        .Text = ".([A-Z]{1,})" 'no current space followed by a capital letter
        .Replacement.Text = ".  \1"
        .Execute Replace:=wdReplaceAll
        .Text = ".[ ]{1,}([A-Z]{1,})" 'one or more current spaces
        .Execute Replace:=wdReplaceAll
    End With
End Sub

Open in new window

0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:ottenm
ID: 37731088
Thanks for the replies.  ssaqibh, I can't do "." with ". " because there are a number of places that already have 1 or 2 spaces.

GrahamSkan, I can't get word to find a match using the regexp.  I copied one of them into the search/replace dialog, but no matches found.  I tried the other one in the navigation/search, and created a doc with dots, spaces and letters (also shown in the snap).  Is there a trick to entering regexp's into those dialogs?  

Thanks for any help-
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 500 total points
ID: 37731112
Have you ticked the 'Use wildcards' checkbox? It's visible if you click the 'More>>' button.
0
 

Author Comment

by:ottenm
ID: 37731120
So polite!!  I had no idea it was my turn to be an idiot.

Well, now that that's out of the way.

Thanks a million GrahamSkan, worked like a charm!!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question