Page 1 of 1

Finding the line where a word appears

Posted: Sun Jun 15, 2008 11:15 pm
by Andycal
Just getting used to the text processing in Rev (thanks for the last bit of help!)

So, I've gone a bit crazy and downloaded a thesaurus (I'm playing with one of the example text editors from RevOnline). The thesaurus is just a comma seperated list with <CR><LF> between each line of similar words.

What I want to do is search for a word and then put the entire line that the word appears in into a field (i.e. the synonyms). So, if I search for a word, how do I return what line that word appears in?

I guess it's something like :

-search for the word
-put line number into a variable (x)

-put line x into fld "synonyms"

Am I close?

Posted: Mon Jun 16, 2008 12:18 am
by TEDennis
Try this -- all in one statement:

[code]put line lineOffset("WordToFind", theThesaurus) of theThesaurus into field "Synonyms"[/code]

Posted: Mon Jun 16, 2008 7:05 am
by Andycal
TEDennis wrote:Try this -- all in one statement:

Code: Select all

put line lineOffset("WordToFind", theThesaurus) of theThesaurus into field "Synonyms"
Wonderful, works a treat!