Hi,
I'm trying to get the search word from a text/passage.
1. After finding the number of occurence of the word
in the passage, no of matches found.
2.Read the no. string with the search word as
illustrated below ("play" is word searched:
.I can "play" the piano well.
.The "play" was the best I've ever watched.
Meaning do I have read the lines with "search word"
and the punctuation "." into an array ?
3.Print out the lines with the search word as
illustrated
I hope to get some suggestions/comments , plz.
Rgds,
--- Troy Denkinger <[EMAIL PROTECTED]> wrote: > On
Tuesday 28 August 2001 00:51, Sunthari wrote:
> > 1. What should I do , if I want to read each line
> of
> > text with the "search word". Should I put the
> > occurence of search word in an array ? (I'm not so
> > sure).
>
> Are you reading in a line at a time and looking for
> a particular word in the
> line? If so, I'd either a) stuff the line in an
> array if I found my search
> term or b) print it to a report. It depends on what
> I wanted to do with it
> later.
>
> > 2. If I want to read the string, provided only a
> > certain length (for e.g., 5 words to the LEFT of
> > "search word" & 5 words to the RIGHT of "search
> > word"). Is there a range to declare but how to
> detect
> > the starting point and end point for each
> occurence?
>
> Look at index() for how to find a string within
> another string and at which
> position.
>
> Regards,
>
> Troy
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]