hartmut Posted December 13, 2013 Posted December 13, 2013 Hello I have a field which contains text of recipes. I want to grab the text between 2 words that are always the same. example: Ingredients apples, oranges, salt, sugar etc. grabs the text "apples, oranges, salt, sugar" Ingredients Blueberries, sugar, salt, wheat, butter, corn meal, milk, cream etc. grabs the text " Blueberries, sugar, salt, wheat, butter, corn meal, milk, cream" Could I please ask you help how to write this calculation to put in a field "Ingredients" Thank you
Raybaudi Posted December 13, 2013 Posted December 13, 2013 If the text starts with Ingredients and stops to etc. you could try: MiddleWords ( text ; 2 ; WordCount ( text ) - 2 )
hartmut Posted December 13, 2013 Author Posted December 13, 2013 It is varying length of the text string between two words. Sometimes it could be much longer.
Raybaudi Posted December 13, 2013 Posted December 13, 2013 The given formula will work with varying length of the text string, if the text starts and ends ALWAYS with those two words. If the text can start with other words before you get to the list of ingredients, then you have to change the calculation.
Lee Smith Posted December 13, 2013 Posted December 13, 2013 What is the purpose of the parsing out these words or grabbing them. i.e. delete them, move them to other fields, etc.?
Raybaudi Posted December 13, 2013 Posted December 13, 2013 Could I please ask you help how to write this calculation to put in a field "Ingredients" I think that there are no doubts.
hartmut Posted December 13, 2013 Author Posted December 13, 2013 To move to another field from another large field of text
comment Posted December 13, 2013 Posted December 13, 2013 There seems to be some confusion here: if the source field starts with the word "Ingredients" and ends with the word "etc.", you can use Daniele's formula. Otherwise look here: http://fmforums.com/forum/topic/59491-advanced-text-calculation/#entry281168
Raybaudi Posted December 13, 2013 Posted December 13, 2013 or try this: Let([ start = Position ( text ; "ingredients" ; 1 ; 1 ) + 11 ; end = Position ( text ; "etc." ; start ; 1 ) ]; Trim ( Middle ( text ; start ; end - start ) ) )
Recommended Posts
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