replacing period-space with period-space-space

B

BorisS

I need to do a find and replace on all single spaces after periods, and
replace with two spaces. The problem, of course, is that if I do just a
straight period-space conversion, I will include the places that already have
a period and two spaces after them (with the find just ignoring the second
space in its search).

How can I indicate that I only want it to find periods with a space and some
character after the space, as the find criteria? And then also importantly,
how do I tell it to replace the period-space with period-two space, and then
leave the character untouched?

Thanks.
 
G

Greg Maxey

Boris,

Here is a macro that will ensure two spaces after full stop puncuation:

Sub TwoSpacesAfterSentence()

Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.MatchWildcards = True
.Text = "([.\!\?]) ([A-Z])"
.Replacement.Text = "\1 \2"
.Execute Replace:=wdReplaceAll
End With

End Sub
 
A

Anne Troy

Hi, Boris. The easiest way to do that, which I've used extensively, is to
replace period-space with period-space-space, and then to run a replace
period-space-space-space with period-space-space until 0 replacements are
made.

************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com
 
G

Greg Maxey

Then it seems that running this macro once would be easier yet:

Sub TwoSpacesAfterSentence()
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.MatchWildcards = True
.Text = "([.\!\?]) ([A-Z])"
.Replacement.Text = "\1 \2"
.Execute Replace:=wdReplaceAll
.Text = "([.\!\?]) {3,}([A-Z])"
.Replacement.Text = "\1 \2"
.Execute Replace:=wdReplaceAll
End With
End Sub
 
T

Tony Jollans

I would search for period, space, (not space) - and replace it with period,
space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.
 
G

Graham Mayor

And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony said:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


BorisS said:
I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 
T

Tony Jollans

I have now (long since) adjusted to using a single space but, purely out of
interest, what is the logic of this?

I understood that double spacing was used to make the gaps between sentences
more noticeable. How do proportional fonts obviate the need for this? The
full stop in most fonts is less obvious than in fixed width typewriter fonts
and the insignificant gap provided by a single space does not clearly mark
the sentence. Is it just that proportional fonts are easier to read anyway,
and therefore we don't need any extra help, or is there some other reason?

--
Enjoy,
Tony


Graham Mayor said:
And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony said:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


BorisS said:
I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 
B

BorisS

and if anyone can explain what proportional fonts are, I'd be curious as
well. My rationale is quite a simple one...the people I am producing this
for like to see a certain amount of space between two sentences. I am
guessing by its name that "proportional" fonts means that spacing actually
adjust?

Let's take a real example. If I wanted EXACTLY 3cm between two sentences
(just picking a number, and assuming that is what is equal to two regular
spaces), how would I accomplish that?

Keep in mind, I also have to full justify the paragraphs I write, so I don't
know if that'll affect the answer given.

Thanks to whomever is providing the education on this (I guess Graham?).

--
Boris


Tony Jollans said:
I have now (long since) adjusted to using a single space but, purely out of
interest, what is the logic of this?

I understood that double spacing was used to make the gaps between sentences
more noticeable. How do proportional fonts obviate the need for this? The
full stop in most fonts is less obvious than in fixed width typewriter fonts
and the insignificant gap provided by a single space does not clearly mark
the sentence. Is it just that proportional fonts are easier to read anyway,
and therefore we don't need any extra help, or is there some other reason?

--
Enjoy,
Tony


Graham Mayor said:
And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony said:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 
G

Greg Maxey

BorisS,

I am not the educator. You asked how to put two spaces after a period and I
offered a suggestion. IMHO the suggested method, while perhaps not perfect,
was more efficient than a series of manual find and replace operations. I
suppose the debate about one or two spaces could go on and on. Personally I
prefer two. Times New Roman is a proportional font. From my observation.
One space after a sentence ending with "w" and the next starting with "T"
looks ok. While a single space after an "l" and the next word a "T" looks
not so OK.



--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

BorisS said:
and if anyone can explain what proportional fonts are, I'd be curious as
well. My rationale is quite a simple one...the people I am producing this
for like to see a certain amount of space between two sentences. I am
guessing by its name that "proportional" fonts means that spacing actually
adjust?

Let's take a real example. If I wanted EXACTLY 3cm between two sentences
(just picking a number, and assuming that is what is equal to two regular
spaces), how would I accomplish that?

Keep in mind, I also have to full justify the paragraphs I write, so I
don't
know if that'll affect the answer given.

Thanks to whomever is providing the education on this (I guess Graham?).

--
Boris


Tony Jollans said:
I have now (long since) adjusted to using a single space but, purely out
of
interest, what is the logic of this?

I understood that double spacing was used to make the gaps between
sentences
more noticeable. How do proportional fonts obviate the need for this? The
full stop in most fonts is less obvious than in fixed width typewriter
fonts
and the insignificant gap provided by a single space does not clearly
mark
the sentence. Is it just that proportional fonts are easier to read
anyway,
and therefore we don't need any extra help, or is there some other
reason?

--
Enjoy,
Tony


Graham Mayor said:
And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony Jollans wrote:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 
S

Suzanne S. Barnhill

I'm not going to get into the debate over one-vs.-two, as that will generate
a loooong thread, but I'll explain about the fonts. If you have ever used a
typewriter, most likely the text you produced was monospaced; that is, every
letter was the same width. Typewriter typefaces are designed so that they
don't look too weird with an i or l (or period) the same width as an m or w,
but the result is certainly distinguishable from a printed book. Print
typefaces have always been proportional; that is, the type character was
only as wide as necessary for the letter, so some chunks of type are wider
than others. Some typewriters could also produce proportional type, but they
were in a significant minority.

The huge majority of computer fonts are proportional. Of the core fonts
supplied with Windows, Times New Roman and Arial are the best-known
proportional fonts. Courier New is a monospaced font, beloved of law offices
and bulk mailers because it makes their documents look typed (though why
anyone would prefer that is beyond me). Generally speaking, proportional
fonts (and ragged right, not justified) are easier to read. Whether adding
an extra space between sentences improves readability or not is subject to
endless debate (you can also get into arguments about whether serif or sans
serif fonts are easier to read).



BorisS said:
and if anyone can explain what proportional fonts are, I'd be curious as
well. My rationale is quite a simple one...the people I am producing this
for like to see a certain amount of space between two sentences. I am
guessing by its name that "proportional" fonts means that spacing actually
adjust?

Let's take a real example. If I wanted EXACTLY 3cm between two sentences
(just picking a number, and assuming that is what is equal to two regular
spaces), how would I accomplish that?

Keep in mind, I also have to full justify the paragraphs I write, so I don't
know if that'll affect the answer given.

Thanks to whomever is providing the education on this (I guess Graham?).

--
Boris


Tony Jollans said:
I have now (long since) adjusted to using a single space but, purely out of
interest, what is the logic of this?

I understood that double spacing was used to make the gaps between sentences
more noticeable. How do proportional fonts obviate the need for this? The
full stop in most fonts is less obvious than in fixed width typewriter fonts
and the insignificant gap provided by a single space does not clearly mark
the sentence. Is it just that proportional fonts are easier to read anyway,
and therefore we don't need any extra help, or is there some other reason?

--
Enjoy,
Tony


Graham Mayor said:
And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony Jollans wrote:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 
T

Tony Jollans

A proportional font is simply one where each letter is as wide as it needs
to be - "i" and "w" being the two extremes. In a non-proportional, or
fixed-width, font each character takes the same width leading to
artificially wide "i"s and narrow "w"s.

If you are fully justifying your text, you do not, and can not, have total
control over individual spacing between words and/or sentences - it will
conflict with the justification. If you try for exact spacing - 3
centimetres, say, using an Advance Field, justification will not work
properly - because, again, there is a conflict.

--
Enjoy,
Tony


BorisS said:
and if anyone can explain what proportional fonts are, I'd be curious as
well. My rationale is quite a simple one...the people I am producing this
for like to see a certain amount of space between two sentences. I am
guessing by its name that "proportional" fonts means that spacing actually
adjust?

Let's take a real example. If I wanted EXACTLY 3cm between two sentences
(just picking a number, and assuming that is what is equal to two regular
spaces), how would I accomplish that?

Keep in mind, I also have to full justify the paragraphs I write, so I don't
know if that'll affect the answer given.

Thanks to whomever is providing the education on this (I guess Graham?).

--
Boris


Tony Jollans said:
I have now (long since) adjusted to using a single space but, purely out of
interest, what is the logic of this?

I understood that double spacing was used to make the gaps between sentences
more noticeable. How do proportional fonts obviate the need for this? The
full stop in most fonts is less obvious than in fixed width typewriter fonts
and the insignificant gap provided by a single space does not clearly mark
the sentence. Is it just that proportional fonts are easier to read anyw ay,
and therefore we don't need any extra help, or is there some other reason?

--
Enjoy,
Tony


Graham Mayor said:
And I would leave it with a single space as double spaces were for
typewriters and we have moved on a bit since then. We now have proportional
fonts :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Tony Jollans wrote:
I would search for period, space, (not space) - and replace it with
period, space, space, whatever the (not space) was. To do this:

Find . ([! ]) - that's period, space, left parenthesis, left bracket,
exclamation mark, space, right bracket, right parenthesis

Replace . \1 - that's period, space, space, backslash, one

Check Use Wildcards
Hit Replace All

You can record code for it if you want.


I need to do a find and replace on all single spaces after periods,
and replace with two spaces. The problem, of course, is that if I
do just a straight period-space conversion, I will include the
places that already have a period and two spaces after them (with
the find just ignoring the second space in its search).

How can I indicate that I only want it to find periods with a space
and some character after the space, as the find criteria? And then
also importantly, how do I tell it to replace the period-space with
period-two space, and then leave the character untouched?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top