Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CFs To Parse First & Last Names

Featured Replies

Has anyone written or seen custom CFs to extract the first and last names from a field? Simple algorithms don't do the trick...they're easy to write but won't work in cases such as 'Ann-Marie Smith' or 'John Mark Osborne' or hyphenated last names such as 'Robert Smith-Jones', and the cases of names with middle initials and names with a suffix such as 'Jr.'

Steve

What are all the possible scenarios?

Ann-Marie Smith F: Ann-Marie L: Smith

John Mark Osborne F: John L: Osborne

Robert Smith-Jones F: Robert L:Smith-Jones

Sammy Davis Jr (Sr, II, III) F: Sammy L: Davis

I think you could ignore middle initials and just approach it from a left word (first) right word(last) perspective once the field had the suffixes substituted out. If the above four are the only forms the data comes in, then it would be just a matter of recognizing a hyphen as joining two words.

There must be more name types that I am not thinking of though...

-Raz

  • Author

There are probably other combinations that need to be handled:

A.F. Jones: 'A.F.'

A. F. Jones: 'A.'

Albert Frank-Thomas Jones: 'Albert'

A. Jeffrey Jones (beats me): 'Jeffrey'?

Filemaker considers a '-' as a field separator, so I would substitute dash with '^' or some other uncommon character. The rules are trickier than the function.

Raz: I'm a ex-Brooklyn boy...where do you live?

Steve

Yes, it is all about the rules.

I might say:

A.F. Jones: F: A. L:Jones

A. F. Jones: F: A. L:Jones

Albert Frank-Thomas Jones: F:Albert L:Jones

A. Jeffrey Jones (beats me): F:Jeffery L:me)

Hmmm, would have to adjust for the last one.

I was thinking about those, but then it becomes a matter of what exactly a 'First Name' is in any particular situation. In a strictly legal sense, Would 'A.F.' be allowed as a first name? I would think that if you wanted to get that specific, you would have to break it out from Given name as a separate field. Unless you are suggesting that the standard is include initials as first name as long as there are no spaces. I have no idea. Maybe there is a style book that covers this?

I'm in Williamsburg - watching the city get washed away. Was actually just thinking about vegas. Much work out there? Got any FM8 Slot templates? Card counting FM mobile solutions?

The FileMaker KnowledgeBase has a great article on parsing names in almost every scenario. The article was written for FileMaker 6 but will work fine for FileMaker 7 or 8.

http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=3638&p_created=1115172740&p_sid=Rc36_39i&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MTA1NCZwX3Byb2RzPTAmcF9jYXRzPSZwX3B2PSZwX2N2PSZwX3NlYXJjaF90eXBlPWFuc3dlcnMuc2VhcmNoX25sJnBfcGFnZT0xJnBfc2VhcmNoX3RleHQ9bmFtZQ**&p_li=&p_topview=1

Wow,

Cheers to not having to come up with that one. Thanks fo the link!

  • Author

Thanks, John. The Filemaker Knowledge Base is a good starting point.

Raz: Slot Template (as in Slot Machine Templete?):

I lived in Midwood Section, and East New York, also in Manhattan (Gramercy Park). Don't know about the job market, but I know I could never move back East...love the weather except when it hits 110.

Steve

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.