May 1, 201312 yr Hi I am constantly coming across situations where I would like to extract the text of varying length between two text strings. I would like to use a insert calculation to get this information to a new field called. " MyINFO" EX Record contains text I used to go to the country to see all the farm animals. Now I stay home. I used to go to the city to view all the tourist sites. Now I stay home. I used to go to the beach to swim in the ocean. Now I stay home. I used to go to the bars to see people. Now I stay home. So in the above cases I am needing to extract the text between "I used to go" and " Now I stay Home." Is there a simple way to do this in an Insert calculation script step? thank you
May 1, 201312 yr Have you looked at the Custom Functions at Brian Dunning's site? There are a least 2 that are called Between,
May 1, 201312 yr Author I don't know how to do that. I went to my custom functions window and pasted in the function but it has errors.etc. I just want to learn how to do this somehow. I don't understand what to do with custom functions but my bigger concern is learning how to do this for my understanding.
May 1, 201312 yr If you want to learn the basic of how to do something like this I would start playing around with the Position (), Left (), Right (), Middle (), length (), and perhaps even Trim () functions. You can use combinations of them to parse characters out of strings.
May 1, 201312 yr Author I see but the example I am using is not extracting characters from the strings it is to get the text between two strings I f I could see how it is done with my example I could understand it I think. I used to go to the country to see all the farm animals. Now I stay home. I used to go to the city to view all the tourist sites. Now I stay home. I used to go to the beach to swim in the ocean. Now I stay home. I used to go to the bars to see people. Now I stay home. I want to get the text between "I used to go" and "Now I stay home." So it seems to become some kind of middle function
May 1, 201312 yr Set Field [ YourTable::MyINFO ; Trim ( Substitute ( YourTable::YourTextField ; [ "I used to go" ; "" ] ; [ "Now I stay home." ; "" ] ) ) ]
May 1, 201312 yr I must have missed the request for a script. Here is a demo of Daniele's calculation he supplied in the past Note: I have updated the file to show the script too. BetweenforMountain_1.fp7.zip
May 1, 201312 yr If you want to learn the basic of how to do something like this I would start playing around with the Position (), Left (), Right (), Middle (), length (), and perhaps even Trim () functions. You can use combinations of them to parse characters out of strings. There some videos that Skeleton Key has posted to YouTube that are pretty good in explaining how to uses these functions individually and in combinations. START HERE
May 2, 201312 yr Author thanks to all of you. That is so cool. Examples are such a good place to start from. Have a great day....
Create an account or sign in to comment