Brian Dunning's FileMaker Custom Functions

FileExtension ( TheFileName )

Returns the file extension from a given file name, regardless of how many periods it has.

  Average rating: 5.0 (1 vote) Log in to vote

Ibrahim Bittar Torres   Ibrahim Bittar Torres - Show more from this author
Eikonsys, S.A. de C.V.
http://www.eikonsys.com

Share on Facebook Share on Twitter

  Sample input:
FileExtension ( "This.Is.My.File.xlsx" )
  Sample output:
xlsx

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function is useful in case you need to take action based on a given file name.

It will return the file extension and then you can do things in your calculations or scripts, based on the result.

Example:

Case ( FileExtension ( Files::FileName ) = "docx", "This is a Word Document" ,
FileExtension ( Files::FileName ) = "xlsx" , "This is an Excel spreadsheet" )

Enjoy!

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: