From: "Michael Pratt" <[EMAIL PROTECTED]>

> Well that doesnt give me what I want.  I want to search a text file
> for a Key word then display the contents to a second keyword.
> 
> For example take the above paragraph and display just ' want to search
> a text file for a Key word '  thats it.

I assumed that if I give you a bolt and a nut (hope the dictinary 
gave me the right translation) you know what to do with it. I thought 
you just cant find the matching nut.

Let's assume you have the whole text you want to search in variable
$string :

        $keyword1 = '.  I';
        $keyword2 = 'then';

        $index1 = index $string, $keyword1;
        $index2 = index $string, $keyword2, $index1 + length($keyword1);

        $result = substr $string, $index1 + length($keyword1), $index2 - 
$index1 - length($keyword1);
        print $result;

Reading the file into a variable is left to the reader as an easy 
homework.

Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
                                        --- me


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to