in reply to date as part of filename
Extracting the date from the filename should be simple enough, something like this ought to do it:
my $fname = 'abcd1.20110429-2345'; my $date = 'NOT FOUND'; if ($fname =~ /(20\d{6})-\d{4}/) { $date = $1; } print $date,"\n";
For comparing date ranges, I'd suggest hitting up CPAN for some modules like DateTime.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: date as part of filename
by zac_carl (Acolyte) on May 12, 2011 at 22:44 UTC | |
by runrig (Abbot) on May 13, 2011 at 00:04 UTC | |
by roboticus (Chancellor) on May 12, 2011 at 22:59 UTC |