Does my code below do what I want it to?
[I want to open a bunch of .csv files, and look for lines that say ACD Call or Give Default. If it says that, grab the line and place it into a new file. So the end file will contain the line ACD Call or Give Default from every one of the .csv files. The other side of this coin is that I have hundreds of files to look through and they vary in size from 1k to 50mb, but I figure the end result should be around 5mb.]
my $Line1;
my @csv_files = glob "D:/CBC/*.csv";
open (OUT,'>D:/CBC/A/TMP00.csv');
while ( $Line1 = <@csv_files>) {
chomp $Line1;
if($Line1 =~ /(ACD Call|Give Default)/){
print OUT "$Line1\n";
}
}
close (OUT);
[I want to open a bunch of .csv files, and look for lines that say ACD Call or Give Default. If it says that, grab the line and place it into a new file. So the end file will contain the line ACD Call or Give Default from every one of the .csv files. The other side of this coin is that I have hundreds of files to look through and they vary in size from 1k to 50mb, but I figure the end result should be around 5mb.]
my $Line1;
my @csv_files = glob "D:/CBC/*.csv";
open (OUT,'>D:/CBC/A/TMP00.csv');
while ( $Line1 = <@csv_files>) {
chomp $Line1;
if($Line1 =~ /(ACD Call|Give Default)/){
print OUT "$Line1\n";
}
}
close (OUT);