Hi Thanks. But there is a small issue. Considering the same example, the piece of code sent by you prints 123456 which is not on the same line as "Test:" But it doesn't print the characters 123456 ABCDEF which is on the same line as "Test:"
Regards, Sudhindra -----Original Message----- From: John W.Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, May 17, 2004 4:56 PM To: Perl Beginners Subject: Re: Query On Monday 17 May 2004 03:15, Sudhindra Bhat wrote: > > Hi Hello, > I wanted some help on a piece of code that I was writing. Well the > requirement is like this. I have a file whose looks like this > > (1) Test: 123456 ABCDEF > > 123456 > > (2) Results: ABCDEF > > Now I want my script to output all the contents between the two tags > Test and Results. i.e. 123456 ABCDEF 123456. Can someone help me with > this? while ( <FILE> ) { if ( /Test:/ .. /Results:/ and !/Test:/ and !/Results:/ ) { print } } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>