G
Geoff Cox
Hello,
The following code will put the addresses from the multiple versions
of the nominal_3.htm files in a series of sub directories of
d:/addresses into a file called addresses-file ...
but I cannot see how to create a different file for each sub
directory...How do I select each different sub directory using
File::Find? Ideas please?! I
Thanks
Geoff
use warnings;
use strict;
use File::Find;
my $dir = 'd:/addresses';
find ( sub {
if ($_ =~ /nomination_3.htm/) {
print ("$_ \n");
open (IN, $_) or die ("Cannot open file $_ \n");
my $line = <IN>;
while (defined($line = <IN>)) {
if ($line =~ /<TD>(.*?)<\/TD>/i) {
open (OUT, ">>d:/addresses/addresses-file");
print OUT ("$1 \n");
}
}
}
}, $dir);
close (OUT);
close (IN);
The following code will put the addresses from the multiple versions
of the nominal_3.htm files in a series of sub directories of
d:/addresses into a file called addresses-file ...
but I cannot see how to create a different file for each sub
directory...How do I select each different sub directory using
File::Find? Ideas please?! I
Thanks
Geoff
use warnings;
use strict;
use File::Find;
my $dir = 'd:/addresses';
find ( sub {
if ($_ =~ /nomination_3.htm/) {
print ("$_ \n");
open (IN, $_) or die ("Cannot open file $_ \n");
my $line = <IN>;
while (defined($line = <IN>)) {
if ($line =~ /<TD>(.*?)<\/TD>/i) {
open (OUT, ">>d:/addresses/addresses-file");
print OUT ("$1 \n");
}
}
}
}, $dir);
close (OUT);
close (IN);