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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
enh2000
Posts: 3
Joined: Sat Feb 20, 2010 11:04 am

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

Post 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"
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post 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$
Post Reply