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

Jan Sundström  Identity Verified
Sweden
Local time: 08:59
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: 08:59
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: 08:59
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: 08:59
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: 08:59
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: 08:59
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: 08:59
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






Across v6.3
Translation Toolkit and Sales Potential under One Roof

Apart from features that enable you to translate more efficiently, the new Across Translator Edition v6.3 comprises your crossMarket membership. The new online network for Across users assists you in exploring new sales potential and generating revenue.

More info »
PDF Translation - the Easy Way
TransPDF converts your PDFs to XLIFF ready for professional translation.

TransPDF converts your PDFs to XLIFF ready for professional translation. It also puts your translations back into the PDF to make new PDFs. Quicker and more accurate than hand-editing PDF. Includes free use of Infix PDF Editor with your translated PDFs.

More info »



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