in reply to Adding a blank line after last line of match
How do you define the end of the exception? I'm going to assume you want to insert a blank link before the first line that doesn't match in a group of successive matches.
my $blank_needed = 0; open(DIFFR, "javaex.log"); while (<DIFFR>) { if (/at / || /xception/) { chomp; print LOGFILE "$_,\n"; $blank_needed = 1; } else { print("\n") if $blank_needed; $blank_needed = 0; } } print("\n") if $blank_needed;
|
|---|