Replace using Wildcards or Regular Expressions in Trados Studio 2017 SR1

What "expression pair using wildcards" should I use in "Find What" and "Replace With" in order to replace dot (.) with comma (,) on several number sequences in Trados Studio 2017 SR1?

For example, a "Chemical_Project.docx.sdlxlif" file has the description of several organic compound syntheses and several different 1H NMR number data, such as, for example, 1H NMR (400 MHz, CDCl3): δ 8.38 (d, J = 4.6 Hz, 1H), 8.00 (dd, J = 8.8, 5.5 Hz, 2H), 7.44 (d, J = 4.6 Hz, 1H), 7.09 (t, J = 8.8 Hz, 2H), 4.41 – 4.14 (m, 4H), 4.05 – 3.75 (m, 4H), 1.37 (s, 9H).

Such different 1H NMR number data is shown on several Source Segments that should be copied to the respective Target Segments, and each dot (.) (only in numbers) should be replaced with a comma (,). The above 1H NMR number data, for example, should be "translated" as " RMN de 1H (400 MHz, CDCl3): δ 8,38 (d, J = 4,6 Hz, 1H), 8,00 (dd, J = 8,8, 5,5 Hz, 2H), 7,44 (d, J = 4,6 Hz, 1H), 7,09 (t, J = 8,8 Hz, 2H), 4,41 – 4,14 (m, 4H), 4,05 – 3,75 (m, 4H), 1,37 (s, 9H)."

In Microsoft Word 2010, the replacement of dot (.) with comma (,) (in several number sequences, as shown above) is done very quickly using:

FIND What: ([0-9]).([0-9])

REPLACE With: \1,\2

Use wildcards


Unfortunately I did not find yet an expression pair similar to ([0-9]).([0-9]) and \1,\2 (using wildcards) that works in Trados Studio 2017 SR1.

Would be possible to use a Regular Expression instead of wildcards? If possible, what regular expression should be used?

Thank you very much for your kind attention.

Best regards,

Renato Colonna Rosman

Parents Reply Children
  • Dear Even Polenka

    Thanks for your very kind suggestion.

    My Trados Studio 2017 SR1 is configured using the Auto-Substitution (on both Project Settings and Options), including numbers, as shown on your message, but such setting is not working correctly.

    I am translating a very big Chemical Patent Text (Project with 270 pages), that was sent by an USA-Customer as a "Project Package".

    The said Project Package contains the "Project.docx.sdlxlift" file that was first submitted to  "Automatic Translation".

    Unfortunately the "Automatic Translation", based on the USA-Customer's Translation Memory database, does not copy accurately each Source Segment containing 1H NMR number data to the respective Target Segment, and does not replace a dot (.) in each number with a comma (,). Thus, it is necessary to copy each Source Segment containing the 1H NMR number data to the respective Target Segment, and, then, to replace manually each dot (.) in each number with a comma (,), which is a very laborious and tiresome work, because the said Project has a huge number of Organic Compound Synthesis Examples containing 1H NMR number data.

    Perhaps I could use the "Advanced Display Filter" in order to show only the non-Translated Target Segments (containing the 1H NMR number data) and, then, replace each dot in each number with a comma, using "Find and replace".

    Do you have another suggestion?

    Thank you very much for your kind attention,

    Best regards,

    Renato Colonna Rosman

    Rio de Janeiro, Brazil.

  • For segments containing only number and non-translatable elements use "Display filter" (from the review tab).
    Insert this regex there:
    ^[\d\W]*$
    This will shown only segments with numbers and non-translatable elements. Select all, copy source to target and confirm.
    If necessary, before confirming replace every comma with #, then replace all dots by commas and in the end replace # by dots.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • Dear Jerzy Czopik

    Thank you very much for your suggestion. I will try it, as soon as possible.

    Using your suggestion on a non-Target Segment as, for example." 1H-NMR-number-data as, for example: "1H NMR (400 MHz, CDCl3): δ 8.38 (d, J = 4.6 Hz, 1H), 8.00 (dd, J = 8.8, 5.5 Hz, 2H), 7.44 (d, J = 4.6 Hz, 1H), 7.09 (t, J = 8.8 Hz, 2H), 4.41 – 4.14 (m, 4H), 4.05 – 3.75 (m, 4H), 1.37 (s, 9H)."- will replace the dot (in each number) with a comma, as shown below?

     "1H NMR (400 MHz, CDCl3): δ 8,38 (d, J = 4,6 Hz, 1H), 8,00 (dd, J = 8,8, 5,5 Hz, 2H), 7,44 (d, J = 4,6 Hz, 1H), 7,09 (t, J = 8,8 Hz, 2H), 4,41 – 4,14 (m, 4H), 4,05 – 3,75 (m, 4H), 1,37 (s, 9H)."

    Thanks.

    Renato Rosman

  • No, here you cannot replace comma and dot with the method given.
    You can however use regex and replace
    (\d),(\d)
    by
    $1#$2
    Then replace
    (\d)\.(\d)
    by
    $1,$2
    And in the end replace
    (\d)#(\d)
    by
    (\d),(\d)

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • Dear Jerzy Czopik

    Thank you very much for your kind attention and suggestion!

    The suggestion (regular expression) of Paul Filkin, as shown below, works perfectly:

    "Paul Filkin:


    Hi Renato Colonna Rosman ,

    I'm wondering if I missed the requirement. Can't you use this?

    Search:
    ([0-9])\.([0-9])

    Replace:
    $1,$2

    ************
    Again, thank you very much for your kind attention,
    Best regards,
    Renato Colonna Rosman

  • This is of course correct, if you just need to change 9.1 to 9,1
    But should you have 1,000,000.0 and like to change to 1.000.000,0 - then this won't work.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • Unknown said:
    This is of course correct, if you just need to change 9.1 to 9,1
    But should you have 1,000,000.0 and like to change to 1.000.000,0 - then this won't work.

    Of course.  But the original question already did this very replacement in Word, so I think all that was required was an explanation of how to do the same thing in Studio.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub