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 }
In reply to Re^2: How to parse this information out?
by kyle
in thread How to parse this information out?
by coltman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |