Hi All,
 
I have a directory of .txt files, a couple thousand and I want to pull out
all the files that have "descriptions/product/MSDS" hard coded in the
document.  Is this possible to do w/ Regexp::Common?  Here is what I have so
far...
 
 
---begin
 
use strict;
use warnings;
use Regexp::Common;
 
my $dir = "J:/flash_host/ecomm/descriptions/product/small";
 
 opendir (SMALL, $dir) or die "Can't open $dir: $!";
 
@ARGV = map { "$dir/$_" } grep { !/^\./ } readdir SMALL;
 
 open SAVESTDOUT, ">>C:/perl/bin/output/stored_msds.txt"
            or die "Open failed";
 
my $regex = "descriptions/product/MSDS";
 
while (<>) {
     print SAVESTDOUT "$ARGV $1\n"
     and close(ARGV) and next
     if /RE =~ {$regex}{-keep}/;
                 }
 
closedir (SMALL);
close SAVESTDOUT;
 
--end
 
Thanks!
 
Brian Volk
HP Products
317.298.9950 x1245
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 
 

Reply via email to