in reply to Re: Help With Parsing a File
in thread Help With Parsing a File

Hi,

while(<fname>){ $/="\n--\n"; ($_ =~ /ABC SET/)?$values++:next; }


Replies are listed 'Best First'.
Re: Re: Re: Help With Parsing a File
by runrig (Abbot) on Jan 18, 2003 at 17:16 UTC
    Not exactly what the OP was asking for. He wants "ABC SET" on one line, and a line with nothing but "--" two lines below it. Your solution will find "ABC SET" and "--", but we don't know how many lines apart they are. This might work though:
    $/="\n--\n"; while (<FILE>) { $value++, next if /.*?ABC SET.*\n.*\n--\n/; }