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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

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

Postby enh2000 » Tue Feb 23, 2010 8:24 am

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: 2164
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Postby DataMystic Support » Tue Feb 23, 2010 11:39 am

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$
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 10 guests