PDA

View Full Version : Replacing text date with mm/dd/yyyy


fcampion
07-Aug-2009, 12:25 PM
Hi,
What is the best way to write an expression to replace a date like "Feb 2, 2009" with "02/2/2009"

I have this column labelled "Date" defined in the grammar tab.


Thank you,

Frank

Aaron
07-Aug-2009, 03:24 PM
Our Data Compare can interpret dates, if you files have delimited data and a Key column.

Otherwise in the Text Compare, you can define two date styles as Unimportant. This will mark all dates as Unimportant, however: Jan 1,2009 and 3-3-2008 would be considered as unimportant as 1-1-2009.
Simply define two "Date" Grammars. One that matches the numeric method and one that matches your text method.
Date=\d{1,2}/\d{1,2}\d{4}
Date=\w{3}\s\d{1,2},\d{4}
Then mark Date as Unimportant in your Text Compare's Session menu -> Session Settings, Importance tab.

Here is a handy KB article with more detail:
http://www.scootersoftware.com/support.php?zz=kb_unimportantv3.php