November 6, 200223 yr 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! Cheers Nick
November 6, 200223 yr You'll need one global number field for counter and one text global for result freeze window set field [gCounter (PatternCount(textField, "@")] if[gCounter] Loop set field [gResult,gResult & "
November 7, 200223 yr 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!", "")
November 19, 200322 yr 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
November 24, 200322 yr BobWeaver said: 1. Pre-process the text field using the substitute function to replace tabs, What character is used for scripting the Tab action ?
November 24, 200322 yr 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
Create an account or sign in to comment