Mobile menu

Replacing format of variable-length character strings in Word
Thread poster: daruthie
daruthie
Local time: 14:24
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:

source=Source
time=time
name2=Name2

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,

Ruth


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 14:24
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.

Regards
Jerzy


Direct link Reply with quote
 

Anh Pham  Identity Verified
United States
Local time: 08:24
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

=A1&B1&C1

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


Direct link Reply with quote
 

Hynek Palatin  Identity Verified
Czech Republic
Local time: 14:24
Member (2003)
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:
(=*^13)
(that's everything between "=" and end of paragraph; use the whole string including parentheses)
Replace with:
\1
(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]


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 14:24
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.

Regards
Jerzy


Direct link Reply with quote
 
daruthie
Local time: 14:24
Spanish to English
+ ...
TOPIC STARTER
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!


Direct link Reply with quote
 


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






Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »
TM-Town
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 »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs