December 13, 201312 yr 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
December 13, 201312 yr If the text starts with Ingredients and stops to etc. you could try: MiddleWords ( text ; 2 ; WordCount ( text ) - 2 )
December 13, 201312 yr Author It is varying length of the text string between two words. Sometimes it could be much longer.
December 13, 201312 yr 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.
December 13, 201312 yr What is the purpose of the parsing out these words or grabbing them. i.e. delete them, move them to other fields, etc.?
December 13, 201312 yr Could I please ask you help how to write this calculation to put in a field "Ingredients" I think that there are no doubts.
December 13, 201312 yr 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
December 13, 201312 yr or try this: Let([ start = Position ( text ; "ingredients" ; 1 ; 1 ) + 11 ; end = Position ( text ; "etc." ; start ; 1 ) ]; Trim ( Middle ( text ; start ; end - start ) ) )
Create an account or sign in to comment