Excluding start/end chars in Word Find & Replace?
Thread poster: Jan Sundström

Jan Sundström  Identity Verified
Sweden
Local time: 17:30
English to Swedish
+ ...
Mar 27, 2007

Hi all,

I first posted this question in the Trados subforum (http://www.proz.com/post/538956#538956), but the crux of the matter is actually a Word problem.

I have a bunch of files that looks like:
=>'Uploaded', 'ulspeed'
=>'Downloaded', 'dlspeed'
etc

I want to tag everything except the source word within the single quotes as tw4winExternal.

Is there any regex that can do this in one single operation?

The current suggestion is that I:
1. Mark the entire document as tw4winExternal
2. Make a wildcard search for
=>'*',
and replace this with (empty) + the tw4winNone template
3. Make separate litteral searches for =>' and ', to convert the start and end chars back to external again.

Or is there an advanced query I can perform in step 2, that would exclude the start/end chars from being changed to tw4winNone?

I learnt a lot from Aleksandr Okunev (author of TortoiseTagger):
http://www.proz.com/post/219086#219086

But this info takes a lot of time to digest and understand, I'm not quite there yet...

Thanks a lot in advance!

/Jan


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 17:30
Member (2003)
Polish to German
+ ...
Do a S&R with following settings: Mar 27, 2007

Search for: '^13*', '
Replace with: ^& and Style "Tw4external"
Wildcard characters on

This will mark everything but the second word in your text als TW4External. Please note, that you will have to modify the very frist segment manually, as there is no paragraph mark before it (^13 is paragraph mark, but you cannot use ^p because of widlcard characters, so you need it's ANSI code, which is ^13).

HTH
Jerzy


Direct link Reply with quote
 

Jan Sundström  Identity Verified
Sweden
Local time: 17:30
English to Swedish
+ ...
TOPIC STARTER
I'll try this... Mar 27, 2007

Interesting solution, Jerzy!
I think I get your point.

To understand what's going on, can you explain what the ampersand represents?! (^&)

Best,

Jan


Direct link Reply with quote
 

Claudia Krysztofiak  Identity Verified
Germany
Local time: 17:30
English to German
+ ...
Are ' and ' different characters? Mar 27, 2007

Your posting suggests that there is a difference between the start and end character. If so, you'd just have to turn around your strategy:

1. Mark the entire document as tw4winNone
2. Make a wildcard search for
=>end character'*start character'
(instead of start character'*end character')
and replace this with (empty) + the tw4winExternal template


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 17:30
Member (2003)
Polish to German
+ ...
Ampersand Mar 27, 2007

Ampersand tells Word to insert everything what it have found. In this particular case it means to insert everything between ' in the paragraph before and ', ' in the next paragraph (this is what Word is looking for) with tw4external style.

Jerzy


Direct link Reply with quote
 

Jan Sundström  Identity Verified
Sweden
Local time: 17:30
English to Swedish
+ ...
TOPIC STARTER
Will not touch first and last segment in each file Mar 27, 2007

Claudia Krysztofiak wrote:

Your posting suggests that there is a difference between the start and end character. If so, you'd just have to turn around your strategy:

1. Mark the entire document as tw4winNone
2. Make a wildcard search for
=>end character'*start character'
(instead of start character'*end character')
and replace this with (empty) + the tw4winExternal template




Hi Claudia,

I've been considering this solution too, but the disadvantage is slightly bigger than with Jerzy's alternative.

Since you search will handle (end character'*start character'), this query will not touch the very first start char + the very last end char in the file.

Not a huge issue, but there are over 200 files, and I want to minimize manual handling.

Best,

Jan


Direct link Reply with quote
 

Vito Smolej
Germany
Local time: 17:30
Member (2004)
English to Slovenian
+ ...
to find QxyzQ Mar 27, 2007

... excluding the starting and ending Q (for quote charachter) the Reg.expression in Word is somewthing like

Q([!Q]@)


explanation:

1. first Q - literal Q character - startup of the interesting sequence

2. ( ..... ) - grouping - so that you can adress it like \1 in replace field

3 [!Q]@ - a string containing anything but Q - i.e ending on Q

that should do it. In replace you say Q\1 and make it translatable, then change Q (sigh, I dont know any better) external.

smo

PS: learnt from Tortoise Alexij (g)

[Edited at 2007-03-27 15:05]


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 »

Excluding start/end chars in Word Find & Replace?

Advanced search






PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

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 »



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