Hello, Since you are having the whole file in an array. 1. Keep an index to specify the current line read 2. Once you found the desired string, you have the index also. So you can decrement the index and get the lines. $inex = 0; foreach $line (@lines) { $index++; if($line =~ m/ CHANNEL_INFO_T/) { $prevLine1 = @lines[$index-1]; $prevLine2 = @lines[$index-2]; } # do something with $line } Hope this helps Madan Dharshana Eswaran wrote: Hi All, --
![]() from Madan Interra Systems India Pvt. Ltd. A10, Sec9,NOIDA Ph: 0120-2442273/4 Ext 137 visit my homepage |
- Re: Regarding files Madan Kumar Nath
- Re: Regarding files Mumia W.
- Re: Regarding files Dharshana Eswaran
- Re: Regarding files Dr.Ruud
- Re: Regarding files Dharshana Eswaran
- (was: Regarding files) Dr.Ruud
- Efficient matching Karyn Williams
- Re: Efficient matching John W. Krahn
- RE: Regarding files Thomas Bätzler