How to add thousand separator(s) as dot(s) using Regular Expression in numbers without any thousand separator(s) in Trados Studio?

What is the correct Regular Expression to be inserted in "Find What" and the Regular Expression to be inserted in "Replace With" (using Regular Expressions) in Trados Studio Editor (2017 to 2021) in order to add one or more thousand separators as dot(s) in numbers like 1000; 10000; 100000, 10000000; 1000000000000; 20000; 1245; 35938; 5000; 50000 on several Translated Target Segments etc.?

For example a huge number of Target Segments show only numbers:

1000

10000

100000

1000000

10000000

100000000

1235567980

1245

34589

50000

500000

The above number should be modified to:

1.000

10.000

100.000

1.000.000

10.000.000

100.000.000

1.235.567.980

1.245

34.589

50.000

500.000

I found some Regular Expressions in Internet that could add thousand separators, but they do not work in Trados Studio!

Thank you very much for your kind attention.

Best regards.

emoji
Parents
  • Dear Paul

    Thank you very much for your kind attention, but the regular expression did not work in Trados Studio 2021 SR2 - 16.2.10.9305.

    I selected, for example, the Target Segment containing only 16825.

    Then I inserted the expression \d(?=(?:\d{3})+(?!\d)) in "Find What",

    then I inserted the expression $0. (because I want to insert thousand dot separator) in "Replace with",

    then I selected "Look in" (Selection), then I chose "use" Regular expressions",

    when I click on "Find Next", the cursor selects the number "[6]",

    when I click on "Replace", I read the answer: "Find complete: no matches found". No thousand separator is inserted. I other words, the number 16825 is not modified to 16.825, it remains as 16825.

    The correct Regular Expressions for Trados Studio should be related to ".NET implementation". I have tested several Regular expressions (.NET implementation) in order to insert one or more thousand separators (as dot (.)) in numbers, but without any success.

    Best regards

    emoji
  • Your description is the identical experience which I've had with version2017.

    emoji
  • The problem, it seems, isn't with the regular expression.  The problem is that Trados Studio, all versions, doesn't handle the replace.  It'll find the correct location each time but the replace expression is completely ignored.  I'm pretty sure there is an existing bug for this but I'll log it again to make sure.

    The solution, or at least one solution, is to install the SDLXLIFF Toolkit from the appstore as this will do it correctly.  I created a short video in Trados Studio 2021 to show you how it works:

    emoji
  • tiny toy

    Just OneClick away..

    Screenshot of Trados Studio interface with a focus on the 'ThousandsSeparator' function highlighted in red and a yellow arrow pointing towards a dialog box asking for the correct Regular Expression to be inserted.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:43 AM (GMT 0) on 5 Mar 2024]
Reply Children