D
david.hunter
Hi group - I need to retain the date in a file, and replace the forward
slash date format with dashes - sounds simple!
here's what I have:
the current date format is --> 2005/07/31
i need to change to --> 2005-07-31
I need a recursive search and replace, but I'll worry aobut being
recursive later - right now I can't seem to get my regex correct.
i can do a find on the date format like this:
my $find = '\\d\d\d\d\/\d{2}\/\d{2}';
my $replace = "-"
<snip>
$infile =~ s/${find}/${replace}/g;
BUT - of course there are two issuies here:
1. The escape character in the $find var makes the script cawk out - I
could only get it to work if I used:
my $find = '\\d\d\d\d';
2. The entire string is replaced - removed the date digits.
Any ideas ?
Thanks again.
slash date format with dashes - sounds simple!
here's what I have:
the current date format is --> 2005/07/31
i need to change to --> 2005-07-31
I need a recursive search and replace, but I'll worry aobut being
recursive later - right now I can't seem to get my regex correct.
i can do a find on the date format like this:
my $find = '\\d\d\d\d\/\d{2}\/\d{2}';
my $replace = "-"
<snip>
$infile =~ s/${find}/${replace}/g;
BUT - of course there are two issuies here:
1. The escape character in the $find var makes the script cawk out - I
could only get it to work if I used:
my $find = '\\d\d\d\d';
2. The entire string is replaced - removed the date digits.
Any ideas ?
Thanks again.