Jump to content
Server Maintenance This Week. ×

comparison "contains"?


This topic is 8279 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

i was trying to do a script that searches for text strings that contain certain character. for example if i want to find if a field contains an email address how can i do the comparison:

[if f3 "contains" @]

how can i put this into a script...

any help will be appreciated..

Link to comment
Share on other sites

You need to use the "PatternCount" step. This is a great step for finding any text you want. You can anter the text - for example "@" to find emails so it would look something like this in a script: (or you could define a calculation field to filter anything you want)

-----

If

PatternCount(F3; "@")>0

End if

-----

now you would have to decide what should happen if there is a "@" present. I use this trick for filtering emails, but also use PatternCount with ".com" ".de" and also domain names etc for sorting emails. Remember, you can also use a field name instead of text, so for example:

PatternCount(F3;F4)>0

PatternCount is one of the most versitile steps. You should invest some time with this. It's explained in the FMP help file, but the basic format is:

PatternCount (Where should it look;What it should look for)it then tels you how many times it found it

Remember, your seperators are maybe different to mine ";"

PS: the other cool thing about PatternCount is that it can find returns or empty spaces, too

Hope this helps,

Rigsby

Link to comment
Share on other sites

This topic is 8279 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.