Regex, variables in XML and Excel files
Thread poster: Hakan Kiyici

Hakan Kiyici  Identity Verified
Turkey
Local time: 22:07
Member (2009)
English to Turkish
+ ...
May 16

Hi,

I was wondering if anyone can help or give direction for this. I use Trados 2015.

I have a client who is likely to have more of this kind of content with variables and placeholders. I have checked the available options of Regex and using variables. But I couldn't make them work.

The file comes in XML and Any XML picks it up. But I would need the solution for Excel file as well (I could not make the Excel option work either. Saw https://multifarious.filkin.com/2013/08/21/embedded_content_excel/ )

I tried to modify Embedded Content Processing etc. Maybe I am looking at this from wrong perspective.

Below is an excerpt.

Any help would be greatly appreciated. It would be great time saver as I am copying the source to the target and moving the variable around by copy-paste.

Thank you


If you understand this and would still like to proceed with %1% choice, click the "{:sidSGAllowExecutionButton:}" button below.[n:15]If the object(s) were previously removed by {:sidMainCaption:}

Please click the "%2%" button to have {:sidMainCaption:} close all %1% windows.[n]To skip scanning %1% cookies, click the "{:sidSkip:}" button.


 

Jaime Oriard  Identity Verified
Mexico
Local time: 14:07
Member (2005)
English to Spanish
+ ...
You're in the right track May 16

You just have to write the regex you need. Try with this simple one:

To catch %...% try %[^\s]+%
To catch {...} try \{[^\s]+\}
To catch [...] try \[[^\s]+\]

Or you could just put them together, like so:
%[^\s]+%|\{[^\s]+\}|\[[^\s]+\]

Be careful though. These are so basic that they may catch strings that need to be translated.

I normally use this site to test my regex: https://regexr.com/

Good luck!


 

Hakan Kiyici  Identity Verified
Turkey
Local time: 22:07
Member (2009)
English to Turkish
+ ...
TOPIC STARTER
will look into this May 16

Hi Jaime,

Thank you for the invaluable information. I will try these.

I believe these should go to Embedded Content Processing section. I tried both XML and Excel version. I will try these if they catch those variables.

Kind regards

Hakan Kiyici

Jaime Oriard wrote:

You just have to write the regex you need. Try with this simple one:

To catch %...% try %[^\s]+%
To catch {...} try \{[^\s]+\}
To catch
try \[[^\s]+\]

Or you could just put them together, like so:
%[^\s]+%|\{[^\s]+\}|\[[^\s]+\]

Be careful though. These are so basic that they may catch strings that need to be translated.

I normally use this site to test my regex: https://regexr.com/

Good luck! [/quote]


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Regex, variables in XML and Excel files

Advanced search







SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »
BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »



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