Quote:
Originally Posted by KevinADC
Similar to my reply in your other thread that I think you didn't read. Assumes same example data from that thread.
This should be more efficient and maybe more accurate:
Code:
#!/usr/local/bin/perl
use strict;
open (MYFILE, 'logs_report') or die "$!";
open (MYF, '>data.txt') or die "$!";
while (my $rec = <MYFILE>) {
next if ($rec =~ /STATE: OK/) {
print MYF $rec;
}
close (MYF);
close (MYFILE);
Pludis code has a small typo, it has $red where it should be $rec.
|
yes i did read your post in the other thread. when i went to use it i wasn't getting any response back. i think the problem was in the line that i bolded.
i'll try this script of yours and see if it outputs something. thanks a million.