PrimeLord has asked for the wisdom of the Perl Monks concerning the following question:
It's something similar to that. Now what I want to do is everytime I see ABC SET I want to look and see if two lines below it is --. If it is than I just need to ++ a variable. If not I want to just move to the next line.1-23-abc45 (11:01) ABC SET foo foo foo. Foo data foo. -- 1-23-cba45 (12:02) ABC RUN foo foo foo. Foo data foo. -- 2-34-xyz21 (12:03) ABC SET foo foo foo. Foo data foo. !
use strict; my $value; open IN, "data.file" or die "$!"; while (<IN>) { chomp; if (/match the lines/) { $value++; } } close IN or warn "$!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help With Parsing a File
by gjb (Vicar) on Jan 17, 2003 at 22:52 UTC | |
|
(jeffa) Re: Help With Parsing a File
by jeffa (Bishop) on Jan 17, 2003 at 23:40 UTC | |
|
Re: Help With Parsing a File
by tall_man (Parson) on Jan 18, 2003 at 00:04 UTC | |
|
Re: Help With Parsing a File
by mirod (Canon) on Jan 18, 2003 at 00:09 UTC | |
|
Re: Help With Parsing a File
by runrig (Abbot) on Jan 18, 2003 at 00:15 UTC | |
by OM_Zen (Scribe) on Jan 18, 2003 at 04:07 UTC | |
by runrig (Abbot) on Jan 18, 2003 at 17:16 UTC |