Automatic date reformating DE->US
Thread poster: Anthony Rudd
Anthony Rudd
Anthony Rudd

Local time: 04:48
German to English
+ ...
Dec 31, 2017

I have the recurring problem of needing to change dates from German format (mm.dd.yyyy, such as 31.12.2017) to US format (yyyy-dd-mm, such as 2017-12-31). Is there some way of automating this process (a large number of date fields is involved). A related problem is there some way of stopping the QA from flagging these as errors, missing number, added number, etc.?

 
Anthony Rudd
Anthony Rudd

Local time: 04:48
German to English
+ ...
TOPIC STARTER
"Replace with" regex not handled correctly. Dec 31, 2017

I have been doing some experimenting, and have written a simple regex that finds the dates that I want:
\d{1,2}\.\d{1,2}\.\d{4}

But when I try to use the matching replacement string in the "Replace with:" expression
$3-$2-$1

$3 etc. are not treated as regexes, but rather the complete string is "$3-$2-$1" replaces the found string.

How do I force the Find/Replace to use regexes?


Find what:
\d{1,2}\.\d{1,2}\.\d{4}
... See more
I have been doing some experimenting, and have written a simple regex that finds the dates that I want:
\d{1,2}\.\d{1,2}\.\d{4}

But when I try to use the matching replacement string in the "Replace with:" expression
$3-$2-$1

$3 etc. are not treated as regexes, but rather the complete string is "$3-$2-$1" replaces the found string.

How do I force the Find/Replace to use regexes?


Find what:
\d{1,2}\.\d{1,2}\.\d{4}
Replace with:
$3-$2-$1

Use regular expressions: activated
Collapse


 
Anthony Rudd
Anthony Rudd

Local time: 04:48
German to English
+ ...
TOPIC STARTER
regex error Dec 31, 2017

I found the error, the individual were not enclosed within brackets, namely,
(\d{1,2})\.(\d{1,2})\.(\d{4})

But what I am still missing is how to include the same matching in QA to avoid false messages.


 
Anthony Rudd
Anthony Rudd

Local time: 04:48
German to English
+ ...
TOPIC STARTER
Regex to convert month name to month number Jan 5, 2018

The RE (\d*)\.(\w*)\.(\d*)
And substution $3-$2-$1
reformats an EU date (such as 21.Feb.2017) to a USA date (2017-Feb-2017)
But how can I convert the month name(e.g. Feb) to the month number (02)?
I have found some snippets, but none that does the task I require.
Can anyone help? I have many dates that need to be converted.


 


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


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

Automatic date reformating DE->US






Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »
Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »