PDA

View Full Version : [SOLVED:] Find a colon and insert a space 2 characters to the right



AustinGuy
04-23-2017, 04:05 PM
In the body of a 2010 Word document, I am selecting a block of one-line paragraphs such as this.

1:09The paragraph always starts with a time value
1:18followed by a short text string. Ignore any other colons.
1:25Insert a space two characters to the right of the colon
12:30Thanks for your help!

I want to search for a colon in the within the first 4 characters of the paragraph, and when found, insert a space two characters to the right of the colon. The result should look like this.

1:09 The paragraph always starts with a time value
1:18 followed by a short text string. Ignore any other colons.
1:25 Insert a space two characters to the right of the colon
12:30 Thanks for your help!


Thanks!!

macropod
04-23-2017, 04:28 PM
You could do this with an ordinary Find/Replace, where:
Find = :^#^#
Replace = ^&^32

AustinGuy
04-23-2017, 06:06 PM
Thank you so much! That was a simple and elegant solution! I was not familiar with ^&

Many blessings!

Brian

macropod
04-23-2017, 09:01 PM
FWIW, ^32 is just a space character - which you could have used instead of ^32. Alternatively, if you wanted a non-breaking space, you could use ^s or ^0160 instead of ^32.

AustinGuy
04-24-2017, 08:02 AM
I knew that 32 was the ascii code for a space. I didn't know what ^& represented, but I assume that it must be the results of the Find.

Thanks again!

Brian

macropod
04-24-2017, 04:18 PM
Yes, ^& represents the 'Find' text. You will see a bunch of different 'special' expressions if you click on the Find/Replace dialogue's 'More' button, then 'Special'. The Find and Replace each has its own set, which varies according to whether or not you're using wildcards.