C
Chris L.
Can someone please provide some assitance with a multi-line matching
problem? I have a datafile that looks like this:
***************DATAFILE************************
START
foo
START
foo
START
foo
bar
foo
bar
foo
bar
START
I am trying to capture the contents between the START and START
delineators. However, only if there are more than 1 line in between
them.
Specifically, I want to capture the entries with 6 lines in between
START and START--
but I want to leave out the entries that are only 1 line between START
and START.
Below is what I have so far-- however, it captures everything in
between START and START. Again, Im trying to catch only the 6 line
stretches between START and START not the 1 line stretches...
----------------------------------------------------------------------------------------------------------
open(FH,"foobar.txt")|| die "Cannot open FHandle: $!";
local $/ = "START\n";
while ( <FH> )
{
s/.*START\n//;
print;
}
close FH;
-------------------------------------------------------------------------------------------------------------
Is there a way to specify the amount of lines?
Thank you very much for your time.
Chris L.
problem? I have a datafile that looks like this:
***************DATAFILE************************
START
foo
START
foo
START
foo
bar
foo
bar
foo
bar
START
I am trying to capture the contents between the START and START
delineators. However, only if there are more than 1 line in between
them.
Specifically, I want to capture the entries with 6 lines in between
START and START--
but I want to leave out the entries that are only 1 line between START
and START.
Below is what I have so far-- however, it captures everything in
between START and START. Again, Im trying to catch only the 6 line
stretches between START and START not the 1 line stretches...
----------------------------------------------------------------------------------------------------------
open(FH,"foobar.txt")|| die "Cannot open FHandle: $!";
local $/ = "START\n";
while ( <FH> )
{
s/.*START\n//;
print;
}
close FH;
-------------------------------------------------------------------------------------------------------------
Is there a way to specify the amount of lines?
Thank you very much for your time.
Chris L.