On Tue, 28 Aug 2012 07:24:55 -0700 (PDT),
muk...@gmail.com wrote:
>oops, the example should have been
>wordposAtIndex(17, "Georg Friedrich Händel, a great componist") should return "3"
Do you want the number of words from 1 to 17 or from 17 to end of
string? If the former, does WORDS(SUBSTRING("Geor...",1,17)) do what
you want? If the latter, use WORDS(SUBSTRING("Geor...",17)) but then
the answer should be 4.
>
>Op dinsdag 28 augustus 2012 16:22:38 UTC+2 schreef (onbekend) het volgende:
>> I am looking for a function that would return the number of a word at a given index position.
>>
>>
>>
>> Example: assuming function syntax is wordposAtIndex(n, haystack)
>>
>>
>>
>> wordposAtIndex(10, "Georg Friedrich Händel, a great componist") should return "3"
>>
>>
>>
>> This way I can retrieve the word at that given index or perform other word proximity processing for that matter. The index would generally result from a rexx pos() or a regular expression match.
>>
>>
>>
>> Cheers,
>>
>> Madou
--
Remove del for email