Replacing format of variable-length character strings in Word
Thread poster: daruthie

Local time: 08:16
Spanish to English
+ ...
Nov 19, 2004

I have a Word doc (150 pages) of a series of character strings separated by a paragraph mark, like this:


I need all the text before the "=" to be in a different colour. I would normally use the ^? character to search and replace everything before the = to do it,
but the number of characters before the = varies in this case, so I can't just
use ^?. Is there a way of telling Word that everything after the ^p and before the = (regardless of length) has to go in a different colour?

Sorry if this has been dealt with before (did a search and didn't come up with anything) or is just a plain stupid question, but I've no idea how to do this and it's a bit urgent.

Hope you can help.

Thanks in advance,



Jerzy Czopik  Identity Verified
Local time: 08:16
Member (2003)
Polish to German
+ ...
I don´t know, if you can search and replace, but you can create a table Nov 19, 2004

Select the whole text, select the menu Table, then choose Text in table and in "Separate text by" enter "=" as a separation mark.
Then you will get a clean table with two columns...
Selecting the first column and changing the coulour of the text is a piece of cake than. Afterwards you cann process your text as table (or convert it immediatelly back). Simply chose the whole table and select now "Table in text", giving "=" as the separator mark.

I´ve checked this right now, it works, and this is very fast.



Anh Pham  Identity Verified
United States
Local time: 02:16
English to Vietnamese
+ ...
Not really Nov 19, 2004

If you create a table with = as the separator, you will lose the ='s in the process, which is bad since they are crucial. What I usually do is this.

1. In word, replace = with 2=2. You can choose any character you want but stay away from the special characters and others that appear in the text. The text will come out like this:

unsubscribe.logon2=2unsubscribe from logon screen

2. Select all (Ctrl+A), copy

3. Open Excel, click on any cell (don't double click). Paste. You will get a table of 1 column and many rows.

4. Data-convert data into columns, choose delimiter, uncheck all options, and in others choose "2" or whatever character you used.

5. You will get 3 columns with

unsubscribe.logon = unsubscribe from logon screen

Now color anything you want.

6. Say you have three columns A, B, and C. After the coloring, click on cell D1 and type


Hit enter

Now in cell D1 you will get

unsubscribe.logon=unsubscribe from logon screen

Pull that cell down all the way and you will get all the original texts in column D with the coloring.

7. Highlight all the cells in Column D that contains any text. Copy

8. Back to Word new document, Paste. You will have that one column with many rows copied from Column D.

9. Convert that Table to text--you will get back to square one with all the text before = in the color you want.

Note that the text to column operation in Excel is not fool proof. Check that everything is in order before you proceed with the coloring.

Hope this helps.

Anh Pham
English/French - Vietnamese


Hynek Palatin  Identity Verified
Czech Republic
Local time: 08:16
English to Czech
+ ...
Search and replace Nov 19, 2004

1. Select all text (Ctrl+A) and apply the different color.

2. Search and replace using wildcards. Search for:
(that's everything between "=" and end of paragraph; use the whole string including parentheses)
Replace with:
(set black color in Format - Font)
Check "Use wildcards".

P.S. I couldn't find a solution with just one search and replace operation. Does anybody have a better idea?

[Edited at 2004-11-19 14:45]


Jerzy Czopik  Identity Verified
Local time: 08:16
Member (2003)
Polish to German
+ ...
Sorry, you have not read my add until end Nov 19, 2004

Anh Pham wrote:

If you create a table with = as the separator, you will lose the ='s in the process, which is bad since they are crucial.

If you need the equation marks during the proces, reconvert the table after changing the colour of the first column back to text, using "=" as a separator.
In this way you get the text converted very quickly.

OTOH the solution of Hynek is a perfect one.



Local time: 08:16
Spanish to English
+ ...
Convert to table option works very well Nov 19, 2004

Thanks everybody for all your help. I decided to use Jerzy's option because it was also recommended to me by a colleague who had tried it previously. It works wonderfully and I can just convert the table back after translation using = as the separator, so there's no character loss.

Great resource!


To report site rules violations or get help, contact a site moderator:

You can also contact site staff by submitting a support request »

Replacing format of variable-length character strings in Word

Advanced search

Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »

  • All of
  • Term search
  • Jobs
  • Forums
  • Multiple search