I have a looping script to extract a series of words from some raw text.

Sample Text:
tagWORDtag2
tagWORD2tag2
tagWORD3tag2

I should be able to extract, WORD, WORD2 and then WORD3 in three iterations of the loop.
I set the variable "$num=$num+1" before each iteration.
I am trying to use a calculation to extract the text as follows:

Middle (
Fieldname ;
Position ( Fieldname ; "tag" ; 1 ; $num) +3;
Position ( Fieldname ; "tag2" ; 1 ; $num) - Position (Fieldname ; "tag" ; 1 ; $num)-3
)

The first iteration does get the first occurrence, "WORD", each additional iteration is returning a blank.
Any suggestions?

Reply via email to