Parsing Text

Shweta

Active Member
Hi
please help with below query-

I am reading a data from website and getting like this in data item-
-----------------------------------------------------------------
Set as default

Search member: Last name: ABC 0 member(s) found
------------------------------------------------------------------
Here, I need to check the number of members. If it is 0, then I need to skip the case else proceed with further processing. So, how can I do that?
 

Pete_L

Active Member
You could use the InStr() function to look for the position of the text "member" in the data item's value. That would give you the starting position of the text. Then, subtract 2 from that number to find the start position of the number preceding the text. Use Mid() to grab the text from that position. The result will be formatted as text, and in this example would be "0". If you need to do math on that value, then convert it to number format first using ToNumber().
 
Top