stuff03 Posted March 5, 2008 Share Posted March 5, 2008 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? Thanks. Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted March 5, 2008 Share Posted March 5, 2008 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] Loop 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, " "] Quote Link to comment Share on other sites More sharing options...
stuff03 Posted March 5, 2008 Author Share Posted March 5, 2008 AHunter... Try what? Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted March 5, 2008 Share Posted March 5, 2008 sorry, hit "post" button while intending to hit "Go Advanced" button. Quote Link to comment Share on other sites More sharing options...
stuff03 Posted March 5, 2008 Author Share Posted March 5, 2008 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? Quote Link to comment Share on other sites More sharing options...
stuff03 Posted March 5, 2008 Author Share Posted March 5, 2008 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. Quote Link to comment Share on other sites More sharing options...
stuff03 Posted March 5, 2008 Author Share Posted March 5, 2008 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? Quote Link to comment Share on other sites More sharing options...
Norma_Snockurs Posted March 5, 2008 Share Posted March 5, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.