Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4451 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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!

Posted

Thanks LaRetta and No_access that did the trick. Updated my profile too...haven't been here in a while.

Posted

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 )
	)
)
Posted

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.

Posted

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.

This topic is 4451 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.