Perl-chick has asked for the wisdom of the Perl Monks concerning the following question:
thanks in advance...$month = '(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)? |Apr(?:il)?|May|Jun(?:e)? |Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)? |Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+'; $day = '[0-3]?[0-9](?:th|st|nd|rd)?,?\s+'; $year = '[0-9]{2,4}'; $dir= "c:/texts/"; $out="c:/scripts/out.txt"; open OUT, ">$out" or die "Cannot open $out for write :$!"; opendir(DIRECTORY, $dir) or die "Can't open $dir: $!\n"; while($file = readdir DIRECTORY){ next if $file=~/^\./; $rfname=$dir . $file; open (CONT, $rfname); while (<CONT>){ if(/( (?:${day}${month}${year}) | (?:${month}${day}${year}) ) /ixo) { print OUT "$file\t $1\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data normalisation
by splinky (Hermit) on Jul 06, 2000 at 17:28 UTC | |
by splinky (Hermit) on Jul 06, 2000 at 17:46 UTC | |
|
Re: Data normalisation
by Ovid (Cardinal) on Jul 06, 2000 at 20:39 UTC | |
by ZZamboni (Curate) on Jul 06, 2000 at 21:17 UTC | |
by Ovid (Cardinal) on Jul 06, 2000 at 21:21 UTC | |
|
Re: Data normalisation
by ZZamboni (Curate) on Jul 06, 2000 at 18:23 UTC |