string search - Forum

Forum Navigation
You need to log in to create posts and topics.

string search

hi, is it possible  to put the Strsearch  in a loop to find a special word in a text? I was not successful. Please help me.

thanks

@kazem

I can not understand how Strsearch in a loop jives with find a special word in a text ... can you give an example of the source string and what you want searched within it ?

Are you looking for the 2nd or 3rd or Nth matching search word ?

 

Hi. Yes. I have file opened and want to to search how many oof a spcial word are there.

@kazem

how many oof a spcial word are there

The best way to get the information you need is to do this ...

SetVar "[speacialWord]" "orange"
StrParse [fileContent] "[specialWord]" [resultingArray]
ArrayLen [resultingArray] [numberOfSpecialWords]

... you may have to expand on this to allow for zero matches or the [specialWord] being located at the start or end of the [fileContent].

luishp has reacted to this post.
luishp