Brian Dunning's FileMaker Custom Functions

fnNameParser ( name ; type )

c. 2012 Drewsol. This CF parses specified name parts (first, last, middle) from a single name field for the flexibility of sorting and/or display. fnNameStraight now handles Spanish names, and some middle-eastern names.

  Average rating: 4.0 (41 votes) Log in to vote

Drew Wesley   Drew Wesley - Show more from this author
Drewsol
https://www.drewsol.com

Share on Facebook Share on Twitter

  Sample input:
fnNameParser™ ( "Martin Luther King, Jr." ; "lastfirstm" )

fnNameParser™ ( "Martin Luther King, Jr." ; "initials" )

fnNameStraight ( "Fransisco de la Hoya" ; "lastfirst" )

fnNameParser™ ( "Andrew Smith-Jones" ; "last" )
  Sample output:
King, Martin L.


MK


de la Hoya, Fransisco


Smith-Jones

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

c. 2012 Drewsol. This CF (procedurally) parses specified name parts (first, last, middle) from a single name field for the flexibility of sorting and/or display. fnNameStraight now handles Spanish names, and some middle-eastern names.

 

Comments

DZakary   DZakary, Toronto, Canada
May 26, 2009
Cool function. I've done similar things, but in a much more brute force manner.

Any thoughts on how to handle hyphenated last names (Andrew Smith-Jones)?
 
Drew Wesley   Drew Wesley, Drewsol
May 27, 2009
I updated the function to support hyphenated last names. Thanks for your feedback.
 
DZakary   DZakary, Toronto, Canada
May 27, 2009
Cool. Thanks for the update.
 
Drew Wesley   Drew Wesley, Drewsol
May 27, 2009
You're very welcome - thanks again for putting it to the test. Enjoy it!
 
Michael Ashley   Michael Ashley, San Francisco
Aug 9, 2010
Great function, thank you.

I was having a problem with diacritics. I added

ä

to the normal character list and presto, all gud.

Thought I'd send the tip along. This helped us out with our Finnish and Swedish friends.
 
Drew Wesley   Drew Wesley, Drewsol
Feb 13, 2012
I've updated this custom function to include more recent user requests.
 
Reggie   Reggie, Inverness, FL
Oct 22, 2012
I can't seem to make this work with hypenated names. It never includes the hyphen and doesn't format the name correctly.
 
Will   Will, Little Rock, AR
Jan 7, 2013
Great function! Thank you for sharing your hard work.
 
Drew Wesley   Drew Wesley, Drewsol
Oct 8, 2013
I added a fix that keeps hyphenated names intact.
 
Scott C   Scott C, Saluda, North Carolina
Sep 14, 2015
How does this function know that "de la Hoya" is the last name?

I import a spreadsheet that contains a field, FullName that includes some records in which the last two words in FullName are the last name so this function would be helpful but I'm curious to understand how it works.

For example, assume FullName = John Van Heusen. The last name is "Van Heusen."
 
Tjebbe van Tijen   Tjebbe van Tijen, IMP
Feb 11, 2016
Good BUT why you throw away the . (points) of First name(s) ?

or did I miss on something, is the type parameter a single one, of several?

I see no functionality to retain the points...

Example

P.H.J. Cuypers

should become

Cuypers, P.H.J.

leaving out the points (is NOT done in any library or documentation environment)

Your function is greatly needed, but please react...or I have to continue trying to write my own one...

Thank you
 
Tjebbe van Tijen   Tjebbe van Tijen, IMP
Feb 11, 2016
Looked into your function a bit more...

I have added the . (point) as something to retain

that helped a bit, but still it does what seems to be a typical FPM flaw

P.H.J. Cuypers

with the parameter LastFirstM

becomes: Cuypers, P.H.J

indeed the point behind the J in the original has gone

also I noticed that you may live in the USA without people having names like

me Tjebbe Willem van Tijen

you rfuncion makes this of it

Tijen, Tjebbe W.

Can NOT be used...

so maybe I have been to optimistic one needs many, many rules to handle names (I have been an academic librarin for decades... so I go back to my own attempt...

though of course I appreciate your effort...
 
Drew Wesley   Drew Wesley, Drewsol
Mar 19, 2016
Hi Tjebbe van Tijen,

I didn't get notified of your post until I checked randomly (I changed my email a year ago). Let me know if you still need help.
 
 
Oct 27, 2019
Drew :

The fnNameParser function does not work with dashes...

Oscar de-la-horta Hernandez - comes out funky

Tried to add a dash or minus sign to the accepted characters and it didn't work...

What other modification can one make to the function so it works right...
 

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: