Jump to content

Extracting Email Addresses


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

Recommended Posts

I'm trying to automate the process of extracting email addresses out of a text field. I have acheived this by locating the '@' and then working backwards and forwards of this to extract the address depending on whether there are spaces or carraige returns (or a combination) before and after the address. The problem I am having is that sometimes there may be tabs either before or after (or both) the address which is causing extra data to be extracted. How can I check to see if this is so - or am I complicating the whole procedure....God I'm confused!!!!confused.gif

Cheers

Nick

Link to comment
Share on other sites

i've bulk extracted email before and found that a lot of them had problems because users didn't enter them properly. this is not directly related to your question, but perhaps you have some use for the following ugly calc field which validates an email address format:

If( WordCount(email) < 2 or PatternCount(email, not "@") or PatternCount(Right(email, Length(email) - Position(email, "@", 1, 1)), ".") = 0 or PatternCount(Trim(email), " "),

"Invalid email address!", "")

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...

This doesn't specifically apply to this question, here are some of general tips about extracting text that I often use to simplify things:

1. Pre-process the text field using the substitute function to replace tabs, commas, periods and other punctuation, with spaces before you do your text search.

2. Concatenate onto the beginning and/or end of your text, a space or

Link to comment
Share on other sites

The tab character doesn't exist in FileMaker, you need to copy a Tab from a text editor and paste it in. Several developers create a g_tab field just for that purpose. That way you can use it in any calculation you need.

Substitute(YOURFIELD, " ", "") would remove the tab.

There is a tab between the first set of "", which I copied and pasted out of my field g_tab.

Or

Substitute(YOURFIELD, ":", ":" & g_tab) would a tab to every instence of : in your text:

HTH

Lee

cool.gif

Link to comment
Share on other sites

This topic is 7483 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.