in reply to I wrote a script to grep
I want the script to check the file for string "Response Queue Size: 0", and if this string has other than numerical 0, I want this to be print to my screen.
open my $infile, '<', 'C:/Users/katragas/Desktop/apadmin_get_status_lo +g.txt' or die $!; while( <$infile> ) { if( /Response Queue Size: (\d+)/ ) { print unless $1 == 0; } }
Your specification is fairly clear now; you've outlined the criteria. The next step is to implement those criteria:
The code I provided above follows those three steps: The while loop iterates over the file, the 'if' statement looks for a pattern of interest, and the 'print unless' statement prints the line unless that line of interest has a number equal to zero associated with it.
Dave
|
|---|