in reply to Re: read multi lines of a file in perl
in thread read multi lines of a file in perl

Hi Richb, Thanks for ur reply.. But i still have a small problem.. as this is able to check for only one loop and not repeated loop.. eg
process lkhls ksjhfk end process process kfhls kfh end process
i want output as
ksjhfk kfh
Thanks....

Replies are listed 'Best First'.
Re^3: read multi lines of a file in perl
by massa (Hermit) on Nov 05, 2008 at 15:01 UTC
    flipflop operator to the rescue:
    perl -lne 'print if /^process/ .. /^end process/ and not /^process/ and not /^end process/' process lkhls ksjhfk end process process kfhls kfh end process
    apparently does what you want:
    ksjhfk kfh
    []s, HTH, Massa (κς,πμ,πλ)