November 12, 201213 yr I am sure this is simple, but I can't figure it out. Need to extract the file name after 'remote:' and before 'FILE' remote:photo_todo.rtf FILE:jbDeliverables/deliverable_list_document/photo_todo.rtf Thoughts?
November 12, 201213 yr Set variable, $pos1 the location of Remote:, ie use Position ( text ; searchString ; start ; occurrence ) set variable, $pos2 the location of file. grab everything in between with Middle ( text ; start ; numberOfCharacters ) numberofcharacters if difference between $pos's, dont forget to take into account the length of the words now run through a loop to get multiple filenames. increment occurrence by 1 in loop.
November 12, 201213 yr To be more specific in case you are new to FM (since you do not show your self-rating), the calculation might look like this: Let ( [ start = Position ( text ; "Remote:" ; 1 ; 1 ) + Length ( "Remote:" ) ; end = Position ( text ; "File:" ; 1 ; 1 ) - 1 ] ; Trim ( Middle ( text ; start ; end - start ) ) ) You can then use it in script to loop as indicated by No_access or you can use Replace Field Contents. Be sure to back up first. :^) Also, are you really still on version 8? If not, it will help if you update your profile. Thank you!
November 12, 201213 yr Author Thanks LaRetta and No_access that did the trick. Updated my profile too...haven't been here in a while.
November 12, 201213 yr You can try it this way. Trim ( Let ( [ prefix = ":" ; suffic = "." ; start = Position ( YourField ; prefix ; 1 ; 1 ) + Length ( prefix ) ; end = Position ( YourField ; suffic ; start ; 1 ) ] ; Middle ( YourField ; start ; end - start ) ) )
November 12, 201213 yr Hi Lee!! The only reason it is recommended to include text instead of focusing on just the colon or period is that those single characters can exist in other locations within the string. By including everything which you know is unique to the string, you can guarantee getting the correct results every time.
November 12, 201213 yr Hi LaRetta, I posted this before I saw you had posted. You are right about, the more start and end information you can use, the better. Anyway, this gives s/he a variant on the formula that can help them in the future.
November 12, 201213 yr Absolutely! Variants of a technique or calculation also shows the underlying principle a bit more. :^)
Create an account or sign in to comment