Jump to content

CFs To Parse First & Last Names

This topic is 5665 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.'


Link to comment
Share on other sites

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...


Link to comment
Share on other sites

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?


Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.


Link to comment
Share on other sites

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.


Link to comment
Share on other sites

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