here is the full code
use strict; use warnings; my $RootDir = "C:\\Perl"; my $AppDir = "$RootDir\\ibmscripts\\stlogsearch"; my $EtcDir = "$AppDir\\etc\\"; my $sendmail = "C:\\usr\\lib\\sendmail"; my $emailconf = $EtcDir . "email_justme.cfg"; my $outfile = "output.txt"; #my $finallist = "output.txt"; open(FILE, "<data/04102013_loginlogs.txt"); my @array = <FILE>; close(FILE); open(FILE, ">>output.txt"); my @array2 = <FILE>; print "Extracting\n"; foreach $_ (@array) { @array2 = grep {$_ =~ "(0x1346)"} (@array); print FILE "@array2"; close(FILE); system("copy $emailconf $outfile"); open(FILE,">>$outfile"); print FILE "@array2"; close(FILE); system("$sendmail -t < output.txt"); exit;}
In reply to Re^2: Using grep to pick out Specific lines in a text file
by itguy87
in thread Using grep to pick out Specific lines in a text file
by itguy87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |