stuj1026 Posted May 8, 2003 Posted May 8, 2003 Hi All.. Need help with a calculation that escapes me. I have a field that I will enter text in. 2 or three lines at the most. I then need a calculation that will search for a word or group of words in the text and then return the next word following. I know I need to use pattern count but the rest escapes me.. Example: I would like to change location to Miami. the calculation ,pattern count, would look for the phrase [change location to] and then return the word miami. Any help would be greatly appreciated. Stu
djgogi Posted May 8, 2003 Posted May 8, 2003 Case(PatternCount(textToParse,searchString),LeftWords(Middle(textToParse,Position(textToParse,searchString & " ",1,1)+Length(searchString)+1,200),numOfWordsToReturn)) whith obviuos meaning for textToParse, saerchString and numOfWordsToReturn Dj
cjaeger Posted May 8, 2003 Posted May 8, 2003 wordsleft(phrase,right(phrase, length(prase)-length(query string)-Position(phrase,querystring;1,1)))
Lee Smith Posted May 8, 2003 Posted May 8, 2003 Hi Chris, Sorry, I couldn't get your calculation to work. wordsleft(phrase,right(phrase, length(prase)-length(query string)-Position(phrase,querystring;1,1))) I changed the obvious (i.e. LeftWords and ";" to "," and standardized the spellings of the different fields, but I'm still missing something. Lee
Lee Smith Posted May 8, 2003 Posted May 8, 2003 Hi DJ, This one works great. I assume your FM version uses WordsLeft instead of LeftWords for this operator? Here is the modified calculation. LeftWords(Right(phrase,Length(phrase)-Length(search)-Position(phrase,search, 1, 1)+1),1) HTH Lee
kyle Posted May 9, 2003 Posted May 9, 2003 hi, lee ! that worked great , too. you call chris as dj. i'm sure you used to use wordsleft, too, huh ? hehehe... just joking.. Regards, kyle
cjaeger Posted May 9, 2003 Posted May 9, 2003 ok, now i will work a little filemaker calc translator which translates my FM calcs from German to English and vv. I already have the mapping file done, just working at the substitution calcs .. I even thought of including script translation, but that is of not much practical use since you cannot paste Scripts into FileMaker. When I post it, maybe somebody will add a French, Italian, Spanish translation...
Lee Smith Posted May 9, 2003 Posted May 9, 2003 I hope you aren't thinking that I'm being critical of you in some way, because I am [color:"red"]not . I marvel at anyone who can speak and write in multiple languages and think your German to English translations are fine. If I had to translate English to German, what you would get would be gibberish. [color:"blue"]> I already have the mapping file done, just working at the substitution calcs > .. What a neat idea. [color:"blue"]> I even thought of including script translation, but that is of not much > practical use since you cannot paste Scripts into FileMaker. Except, if something is written out, it can then be typed in. So, maybe you could use Print2Pict (or an equivalent) for either printing to script to text file, or paste to clipboard, which could then it can be pasted into a text field? Once there, it could be manipulated with either a second field using substitutions, or a script translate it to the language of choice.. [color:"blue"]> > When I post it, maybe somebody will add a French, Italian, Spanish > translation... > I look forward to your posting it to the Open Source area, and where we all can add to it and watch it grow and thus end up benefiting from it. Thank You Lee
Ugo DI LUCA Posted May 9, 2003 Posted May 9, 2003 Hi Christian, Great idea, I'll take the french version of it. . In these forums, we obviously are the "minority", so we must adapt ourselves. That's the big rule of any "virtual" immigrant ... I always have a "US FM Book Manual Pdf" on my Mac Desk, but it sures would make a difference with such a tool. When it comes to complex calc, scripts or whatsoever, having a sample test file is great as any syntax, calc "words" is auto-translated... I was thinking of something. I can't remember if the Country System is something you can choose while installing FM. If so, it would surely be helpful to install FM twice, one with the local and one with the US. Is it possible ?
stuj1026 Posted May 19, 2003 Author Posted May 19, 2003 By the way if anyone is interested the reason we needed this.. We have a data base that by using mail-it plugin will check a set up email account at our site every minute using events from azium. When it retrieves the email it will look to the subject line for a password which it will compare to passwords set up in that database. It then uses pattern count to look for phrases in the body of the message .. We have 5 items set up now. When it finds those phrases it will run a report and set a text field which is then e-mailed back to the user. The item I could not figure out wass returning the next word.. We use chage location so the user can tell the system where it should emial the results to.. It is working quite well. Thanks for all the help people.. Stu
Recommended Posts
This topic is 7858 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