Ritte Posted January 4, 2011 Posted January 4, 2011 Hi, let's say that I've two fields. Field 1 contains "Hi, my name is john and I'm learning filemaker" I want to be able to tell Field 2 to display Field 1, but Erase after a certain value. Example, I tell it to erase from the word "my". Which will contribute that the Field 2 only displays "Hi," from field 1.
Ritte Posted January 4, 2011 Author Posted January 4, 2011 One way should be using leftwords, but I can't manage to make it work. I'm trying to use trim to display everything after my.
comment Posted January 4, 2011 Posted January 4, 2011 display Field 1, but Erase after a certain value. Your question is not clear enough: how do you determine which word is the "certain value"? If it's always the second word, then = LeftWords ( Field 1 ; 2 ) should do. Make Field 2 a Calculation field, with the result type set to Text.
Ritte Posted January 4, 2011 Author Posted January 4, 2011 Your question is not clear enough: how do you determine which word is the "certain value"? If it's always the second word, then = LeftWords ( Field 1 ; 2 ) should do. Make Field 2 a Calculation field, with the result type set to Text. I'll Import form to filemaker. Every form includes. eg. "Address", so I know that Adress Is present. But I don't know if it's the 15th or 16th value since a customer can have double aftername etc. So, I want to tell filemaker to delete everything starting from address, in every post.
comment Posted January 4, 2011 Posted January 4, 2011 (edited) Every form includes. eg. "Address" Can you provide an example or two of the imported data? Is it all imported into one field? Is the address (or at least the word "Address") always present? Are there any separators between the form fields, e.g. carriage returns? Edited January 4, 2011 by comment
Ritte Posted January 4, 2011 Author Posted January 4, 2011 Can you provide an example or two of the imported data? Is it all imported into one field? Is the address (or at least the word "Address") always present? Are there any separators between the form fields, e.g. carriage returns? I want to import email-forms to filemaker. So step one is import the mail to one field: "Förnamn * Test Efternamn * Testson Adress * östergatan 36c Postnummer * 25269 Ort * råå Mobiltelefon 0760491556 Epost * [email protected] Antal guldpåsar 1 " But I want the entered data by the customer (ex name,address) in a seperated fields. So I've created a new filed with: Let ( L = Length ( plainmail ) ; Trim ( Right ( plainmail ; L - Position ( plainmail ; "*"; Förnamn ; 1 ) ) ) ) This displays everything but the first word (Förnamn *): "Test Efternamn * Testson Adress * östergatan 36c Postnummer * 25269 Ort * råå Mobiltelefon 0760491556 Epost * [email protected] Antal guldpåsar 1 " So what I want to do is to trim from the other direction so that only Test is displayed. The underlined text is always present it all forms, they are the title of the field the fill in our website.
comment Posted January 4, 2011 Posted January 4, 2011 If it can be assumed that there are no carriage returns within the response, you could use = Let ( [ prefix = "Adress" ; i = ValueCount ( Left ( ImportedData ; Position ( ¶ & ImportedData & ¶ ; ¶ & prefix & " *¶" ; 1 ; 1 ) ) ) ] ; GetValue ( ImportedData ; i + 1 ) ) to extract the address, for example. See also: http://fmforums.com/forum/showpost.php?post/289685/
Ritte Posted January 4, 2011 Author Posted January 4, 2011 If it can be assumed that there are no carriage returns within the response, you could use = Let ( [ prefix = "Adress" ; i = ValueCount ( Left ( ImportedData ; Position ( ¶ & ImportedData & ¶ ; ¶ & prefix & " *¶" ; 1 ; 1 ) ) ) ] ; GetValue ( ImportedData ; i + 1 ) ) to extract the address, for example. See also: http://fmforums.com/forum/showpost.php?post/289685/ Wow, that worked very well. I only get a slight problem. I have a value without a "*", I try to edit your formula so that it doesn't require the * but no success. What should I remove? Thanks again for your help.
comment Posted January 4, 2011 Posted January 4, 2011 I have a value without a "*" Try specifying the entire prefix (including the " *" if there is one) in the prefix variable: Let ( [ prefix = "Adress *" ; i = ValueCount ( Left ( ImportedData ; Position ( ¶ & ImportedData & ¶ ; ¶ & prefix & ¶ ; 1 ; 1 ) ) ) ] ; GetValue ( ImportedData ; i + 1 ) )
Recommended Posts
This topic is 5130 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