How to Find and Replace, except when the word starts a line
Thread poster: John Fossey
John Fossey
John Fossey  Identity Verified
Canada
Local time: 01:39
Member (2008)
French to English
+ ...
Dec 30, 2022

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
Becca Resnik  Identity Verified
United States
Local time: 01:39
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.

 
Riccardo Schiaffino
Riccardo Schiaffino  Identity Verified
United States
Local time: 23:39
Member (2003)
English to Italian
+ ...
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
Becca Resnik  Identity Verified
United States
Local time: 01:39
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.


 
Riccardo Schiaffino
Riccardo Schiaffino  Identity Verified
United States
Local time: 23:39
Member (2003)
English to Italian
+ ...
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


Hans Lenting
 
Becca Resnik
Becca Resnik  Identity Verified
United States
Local time: 01:39
Member
German to English
+ ...
. Dec 31, 2022


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.


Riccardo Schiaffino
 
Denis Fesik
Denis Fesik
Local time: 08:39
English to Russian
+ ...
Three steps Dec 31, 2022

First, replace "^Director" with "zzzdirector". Next, replace "Director" with "director." Finally, replace "zzzdirector" with "Director"

Stepan Konev
 


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






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »