in reply to Re^2: How to find content between KEYWORD and BLANKLINE then print it
in thread How to find content between KEYWORD and BLANKLINE then print it
This is what ended up working perfectly-
Error: was my keyword and I wanted all of the error message below it until a blank line was found.use strict; use warnings; my $file = $ARGV[0]; open( my $fh, '<', $file ) or die "Can't open $file: $!"; while ( <$fh> ) { if ( /Error:/i .. /^\s*$/ ) { print; } } close $fh;
Thanks again!
|
|---|