Page 1 of 1

Converting 2 digit year to 4 digits (10 to 2010)

Posted: Tue Feb 23, 2010 8:24 am
by enh2000
I've searched the forum and the documentation but have not been able to find a solution to my problem.

In my original input text file, there is a date field that is not providing the 2 digit century numbers. 99 instead of 1999, or 05 instead of 2005.

Is it possible to create a filter that will let me find the two digit (ex. 99 or 05) and use a formula or rule that says if the two digits are 10 or under it should be "20xx" and if it's 11 or above to use "19xx"

Re: Converting 2 digit year to 4 digits (10 to 2010)

Posted: Tue Feb 23, 2010 11:39 am
by DataMystic Support
Easy - use the pattern
(0\d) - which matches numbers under 10, replace with 20$1$
([1-9]\d) which matches the remainder, replace with 19$1$