A READER ASKS: Extract email addresses in FileMaker

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

A READER ASKS
I have a tricky problem. My employer needs me to extract email addresses from the “Sender” field of emails imported using the plug-in Email to FileMaker Importer. I need to return as text just the email address that falls within the “<” and “>” for example, or
Jon Doe or
Jon Doe @ Google.com
would return: jondoe@aol.com

The problem I find are the variables in the Sender text (as above), and the variables of valid email separators _ or – or . makes the word count different so the function RightWords doesn’t work.

How can I just find a text value inside the “<” and “>” ???

Thank you, and feel free to post this interesting and useful issue.

-------
DWAYNE RESPONDS
Sure, this is a practical application for text parsing. What you want to do is use the Position and Middle functions. The position function returns the position of a specified string of text within a search string. You want to get the position of the first < character and the position of the first > character. Then you will want to get all the characters that are in between by using the Middle function.

If you are going to have multiple email address text strings, you will want to count the number of < characters and that can be accomplished via the PatternCount function.

More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2010 - Dwayne Wright - dwaynewright.com