in reply to Re: How to parse this information out?
in thread How to parse this information out?
This prints an extra blank line for every input line that does not match. Taking a cue from Anno's solution, you could fix this by inserting a for. You also get an extra newline where there's a matching phrase on a line by itself. Fix with chomp.
$\="\n"; while (<>) { chomp; @s=split /\s{3,}/; # split the input into phrases print for grep /NOTICE/, @s; # print the matches }
|
|---|