Replacing format of variable-length character strings in Word Thread poster: rek21
| rek21 United Kingdom Local time: 00:31 Spanish to English + ...
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 ... See more 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 ▲ Collapse | | | Jerzy Czopik Germany Local time: 01:31 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 no... See more 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 ▲ Collapse | | | Anh Pham United States Local time: 19:31 English to Vietnamese + ...
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'... See more 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 ▲ Collapse | | | Hynek Palatin Czech Republic Local time: 01:31 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 ... See more 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] ▲ Collapse | |
|
|
Jerzy Czopik Germany Local time: 01:31 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 | | | rek21 United Kingdom Local time: 00:31 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! | | | 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 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 Trados, MemoQ, Wordfast & major CAT tools.
Download and start using CafeTran Espresso -- for free
Buy now! » |
| Wordfast Pro | Translation Memory Software for Any Platform
Exclusive discount for ProZ.com users!
Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value
Buy now! » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |