My datafile is:
abc 234
def 888
keyword1
------- -------
1234 202 want it
2345 305 want it
34567 7732 want it
secondkeyword
more lines
I do: (somewhat psydo-code)
$data = file ("mydatafile ");
foreach ($data as $line) {
if ( secondkeyword ) $on = 0;
if ( $on == 1 ) {
grab numbers in case statment;
}
if ( strstr ($line, "keyword1") ) $on = 1; loose keyword1 line
}
My question is: is there a way to do $data++; when
the first keyword is seen to skip the "----- ------"
line? Or do I have to brute force code around it?
In AWK I would just put "getline" with the $on = 1
entry.
Tks
Chuck
abc 234
def 888
keyword1
------- -------
1234 202 want it
2345 305 want it
34567 7732 want it
secondkeyword
more lines
I do: (somewhat psydo-code)
$data = file ("mydatafile ");
foreach ($data as $line) {
if ( secondkeyword ) $on = 0;
if ( $on == 1 ) {
grab numbers in case statment;
}
if ( strstr ($line, "keyword1") ) $on = 1; loose keyword1 line
}
My question is: is there a way to do $data++; when
the first keyword is seen to skip the "----- ------"
line? Or do I have to brute force code around it?
In AWK I would just put "getline" with the $on = 1
entry.
Tks
Chuck
Comment