in reply to Re: multi-line match
in thread multi-line match

The easiest way would be to use two passes. The first adds a blank line before each header:

perl -ple"$_ = qq[\n] . $_ if /^*header/" infile >modified

NB! Different quotes on *nix!

The second pass is just which ever of the earlier answers you like best.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

Replies are listed 'Best First'.
Re: Re: Re: multi-line match
by pdotcdot (Acolyte) on Aug 08, 2003 at 09:33 UTC
    Thanks very much BrowserUk and all monks, i'm still sorting out different multiline queries but i am determined to get there! thanks again!