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 6674 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

This has got to be the most basic thing but... needing to remove filename suffixes I try: "leftwords ( filename.ai ; 1)" expecting it to return "filename"? but get "filename.ai". I am using "Trim (Substitute (filename; ".ai"; "") to achieve the result but it seems a bit flakey; what if the suffix is .psd for instance?. Any ideas?

Edited by Guest
Posted

I think you need Left(text; Position ( text ; "." ; 1 ; 1 ))

You'd replace numOfChars in the Left function with the results of the Position function.

HTH

Posted

Good one; thanks but you have to put "-1" at the end, otherwise you get the "." :)-

Left ( file name; Position ( file name ; "." ; 1 ; 1 )-1)

Posted

Actually, since file name can contain more than one period (at least in OS X it can), e.g. "MyFile.fp7.zip", it should be:

Left ( FileName ; Position ( FileName ; "." ; Length ( FileName ) ; -1 ) - 1 )

Posted

yeah, but only if you want to return all bar the last suffix.

"guff.guf.guf" yields "guff.guf"

hmmm... and leftwords needs a space after the "."

Posted

Your original question was:

needing to remove filename suffixes ... expecting it to return "filename"

I believe the filename suffix (or more precisely, the filename extension) IS the last suffix - and ONLY the last suffix. Everything bar the last suffix IS the filename. If your requirement is different, please clarify.

This topic is 6674 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.