nelliott Posted November 6, 2002 Posted November 6, 2002 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
djgogi Posted November 6, 2002 Posted November 6, 2002 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 & "
stefangs Posted November 7, 2002 Posted November 7, 2002 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!", "")
vierdewereld Posted July 5, 2003 Posted July 5, 2003 This is what I use to validate the Email entry. PatternCount(eMail, "
vierdewereld Posted November 19, 2003 Posted November 19, 2003 Here's an update: PatternCount(eMail, "
BobWeaver Posted November 19, 2003 Posted November 19, 2003 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
mse Posted November 24, 2003 Posted November 24, 2003 BobWeaver said: 1. Pre-process the text field using the substitute function to replace tabs, What character is used for scripting the Tab action ?
Lee Smith Posted November 24, 2003 Posted November 24, 2003 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
mse Posted November 24, 2003 Posted November 24, 2003 Earlier, I've tried Trim(Substitute(Substitute(Substitute(ExtractedString; "
Recommended Posts
This topic is 7673 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 accountSign in
Already have an account? Sign in here.
Sign In Now