Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Finding anything that resembles and email address


Recommended Posts

I've used some command prompt type scripts in windows to find and extract anything that resembles an email address from any text file with extreme accuracy... Our original database never had its own field for "email address" up until about a year ago... Never Mind! So I have about 20,000 records that may contain an email address somewhere in the record (1 of 3 Fields) the salesmen were never consistent. But it also may be among other text.


Is there a way within filemaker to search for anything that resembles an email address and copy it to the email address field?



Link to comment
Share on other sites

Where LongUglyTextString is a text block that may or may not contain one or more email addresses, and where you're sticking multiple email addresses in a portal with one EmailAddressesPortal::Email Address value per portal row, try this:


Set Variable [$Pos, 1]

If [Right (YourTable::LongUglyTextString, 1)≠ " "]

.. Set Field [YourTable::LongUglyTextString, YourTable::LongUglyTextString & " "]

End If

Go to Field [EmailAddressesPortal::Email Address]


Set Variable [$GetEmail,

Let (stringto@ = Left (YourTable::LongUglyTextString, Position(YourTable::LongUglyTextString, "@", 1, $Pos)-1);

spacesbefore@ = PatternCount (stringto@, " ");

spaceposX = Position (stringto@, " ", 1, spacesbefore@);

spaceposY = Position (YourTable::LongUglyTextString, " ", 1, spacesbefore@+1)];

Middle (YourTable::LongUglyTextString, spacepoxX+1, spaceposY-spaceposX-1)


Go to Portal Row [Last]

Set Field [EmailAddressesPortal::Email Address, $GetEmail]

Set Variable [$Pos, $Pos + 1]

Exit Loop If [GetAsNumber ($Pos)+1 > PatternCount (YourTable::LongUglyTextString, " "]

Link to comment
Share on other sites

I understand what this is supposed to do, but... it will not let me use the commands "spacesbefore" and "stringto" is there something that completely went over my head here?

Link to comment
Share on other sites

Ok here is an example of one of the fields that I need to copy the email address.


Quoted price includes discount3-22 Armin wanted price for installation ($1000 per door)


Armins email is jakebetty@n-connect.net


Is there a way to set the variable as the character count of the first character of the email address and then the last? That way if I had both of those variables, I could just use the "set selection" script step.

Link to comment
Share on other sites

Ok... So I can find the character number position of the @ symbol... So from that point, can you find the character position of the first and last letter of the word that the @ symbol is in?

Link to comment
Share on other sites

it will not let me use the commands "spacesbefore" and "stringto"

There is an orphaned Right Square Bracket in the calc. Try putting a Left Square Bracket right before where "stringto@" gets set-up:


 Let ( [ stringto@ = ...etc. etc.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use