Brian Dunning's FileMaker Custom Functions

AbbreviateText ( text )

Returns the first letter of each word in a text in upper case, each separated by a period and a space.

  Average rating: 4.1 (32 votes) Log in to vote

François Goulet   François Goulet

Share on Facebook Share on Twitter

  Sample input:
Ex.1: AbbreviateText ( "Jean-Paul Sartre" )
Ex.2: AbbreviateText ( "Mary Jane Andrews" )
  Sample output:
Ex.1: J.-P. S.
Ex.2: M. J. A.

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

This custom function (Inspired by Ray Cologon's "Acronym" c.f.) will return the first letter of each word in a text (in upper case), seperated by a period and a space. Please note that hyphonated words such as the name "Jean-Paul Sartre" will return" J.-P. S.". Examples:

AbbrereviateText ( "Paul Wakes" ) will return: P. W.
AbbrereviateText ( "Mary Jane Andrews" ) will return: M. J. A.
AbbrereviateText ( "Jean" ) will return: J.
AbbrereviateText ( "Jean-Paul" ) will return: J.-P.
AbbrereviateText ( "Jean-Paul Sartre" ) will return: J.-P. S.
AbbrereviateText ( "as soon as possible" ) will return: A. S. A. P.

 

Comments

Bart Bartholomay   Bart Bartholomay, Florida
Jan 27, 2013
i believe that in this country the hyphen is not used. In most cases a spaceis used, but I've also seen no space, too. You might want to think about a type parameter that could let the user choose.
 
François Goulet   François Goulet, Montreal, Quebec, Canada
Jan 28, 2013
Thanks for your comment Bart...

When quoting a French author in a paper written either in French or English, I believe one needs to leave hyphens where required (as well as spaces) when using the APA sources reference style (e.g. "Jean-Paul Sartre" would need to be referenced as "SARTRE, J.-P.").

Your comment did however prompt me to write a new cf. (that references the AbbreviateFirstName cf.) which will allow the suppression of spaces and/or hyphens that would otherwise be present when using the AbbreviateFirstName cf. alone.
 
François Goulet   François Goulet, Montreal, Quebec, Canada
Jan 28, 2013
By the way, the new custom function referred to in my previous post is named "AbbreviateFirstNameCustom"
 

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: