How to Find and Replace, except when the word starts a line Thread poster: John Fossey
| John Fossey Canada Local time: 05:59 Member (2008) French to English + ...
I am translating a series of documents and need to find a way to Find and Replace all instances of a word except when it is the first word of the line. For example, the word "Director" has been translated hundreds of times with the first letter capitalized "Director". Now the client wants it changed to all lower case "director". This is easy enough with the Find and Replace function, except that when the sentence begins with the word "Director" the "D" should remain capitalized. ... See more I am translating a series of documents and need to find a way to Find and Replace all instances of a word except when it is the first word of the line. For example, the word "Director" has been translated hundreds of times with the first letter capitalized "Director". Now the client wants it changed to all lower case "director". This is easy enough with the Find and Replace function, except that when the sentence begins with the word "Director" the "D" should remain capitalized. How can I tell the Find and Replace function to only find instances when the word does not begin the sentence? ▲ Collapse | | | Becca Resnik United States Local time: 05:59 Member German to English + ... Use a space at the start | Dec 31, 2022 |
If I understand the issue correctly, I believe using a space at the start of the search phrase should be just what you need. | | | That wouldn't work in some instances | Dec 31, 2022 |
Becca Resnik wrote: If I understand the issue correctly, I believe using a space at the start of the search phrase should be just what you need. That wouldn't work in some instances for example "Item 3: Director's fees to be rewarded blah blah (Director's fees are defined as blah blah)". Here the first instance of Director would be correctly be replaced, but the second wouldn't. | | | Becca Resnik United States Local time: 05:59 Member German to English + ... Always check | Dec 31, 2022 |
Riccardo Schiaffino wrote: Becca Resnik wrote: If I understand the issue correctly, I believe using a space at the start of the search phrase should be just what you need. That wouldn't work in some instances for example "Item 3: Director's fees to be rewarded blah blah (Director's fees are defined as blah blah)". Here the first instance of Director would be correctly be replaced, but the second wouldn't. Yes, it's always worth checking for instances like these, but it should work for all the "typical" instances. I almost mentioned this but figured it was understood. | |
|
|
The solution may depend on the tool you are using | Dec 31, 2022 |
Hi John, The solution might depend on the tool you are using. If you need to do this in MS Word a solution could be to search using wildcards: Find what: ([ \(])(Director) Replace with: \1director This means "search for a space or an open bracket followed by the word 'Director', and replace it with the same space or open bracket followed by the word 'director'" If you are using a CAT tool like Trados or memoQ, you can do the same... See more Hi John, The solution might depend on the tool you are using. If you need to do this in MS Word a solution could be to search using wildcards: Find what: ([ \(])(Director) Replace with: \1director This means "search for a space or an open bracket followed by the word 'Director', and replace it with the same space or open bracket followed by the word 'director'" If you are using a CAT tool like Trados or memoQ, you can do the same using a regex search: With the "regex" option on (and, if you are in Trados, the option "case sensitive" selected), search for (?<!^)(Director) and replace it with director The regex pattern means "search for the word 'Director' so long as it is not the first word in a segment"
[Edited at 2022-12-31 01:33 GMT] ▲ Collapse | | | Becca Resnik United States Local time: 05:59 Member German to English + ...
If you are using a CAT tool like Trados or memoQ, you can do the same using a regex search...
This part should be applicable, as the post is in the memoQ support forum. However, this would still require double checking. For example, many style guides require that if a complete sentence follows a colon, the first word must be capitalized. | | |
First, replace "^Director" with "zzzdirector". Next, replace "Director" with "director." Finally, replace "zzzdirector" with "Director" | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » How to Find and Replace, except when the word starts a line 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! » |
| 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 » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |