Monks help needed
i am new to perl..i got a output file which contains two different strings. if my search matches string1, just print that line and if my search matches string2 , count the occurances and print the count
i tried the below but it is not printing count
#!/usr/bin/perl my %count; @files = <C:/temp/CHOP/*JUNE*>; foreach $file (@files) { open (FILE,"$file"); print "=====$file=====\n"; while($line= <FILE>) { print "$line" if $line =~ /Total/; } while ($failed= <FILE> ) { if (failed =~ /failed/) { $count{$failed)++; } } close FILE; print "Total Volume Failed to Resolve:$count{$failed} \n" ; }
In reply to Process multiple files in a directory by born_Today
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |