Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing Names in multiple formats

Swi

Programmer
Feb 4, 2002
1,965
US
Hi,

I see the following link for parsing names.

https://www.experts-exchange.com/ar...asic-6-and-Visual-Basic-for-Applications.html

It does a pretty good job. However, for off the wall formats like LastName,FirstName MiddleName Suffix

The only thing I have found to reorder a name properly with many types of name orders is AI.

Does anyone else know of a program or code to handle variations. Maybe even a way to pass sometime to AI recursively and have it return the name parts?

Looking for an automated way to do this. The customer has stated that the data comes to them that way but they want it in Prefix, FName, MName, LName, Suffix order.

Thanks.
 
they want it in Prefix, FName, MName, LName, Suffix order.
I assume you want to store the names in a table with fields:
Prefix
FName
MName
LName
Suffix


What data do you have to start with? Is it already 'split'? (I would doubt it)
It would be nice to know: what do you have and what do you want to end up with?
 
Doing this sort of thing is problematical. Take the name

Charlie Oliver

Now, is that actually Charlie Oliver, or is it Oliver Charlie

And if it is Charlie Oliver, is that Mr Charlie Oliver?Or Mrs Charlie Oliver?

This is why, when it comes to names, it is better to get them in the right format at the point the data is input.
 
I truly wish I could get good names at the start... Here is a sampling of the formats. Looks like Last Name is always first. Like a government inverse but the suffix is not consistent.

DOE,JOHN J
DOE,JANE MARIE
DOE,JOHN J III
DOE JR,JOHN J
OLIVER,CHARLIE
DOE FAHLER,JANE
 
Consistency is the key.
Even if you split your names by the comma, you still need to do additional manipulations.

Code:
DOE          JOHN J
DOE          JANE MARIE
DOE          JOHN J III
DOE JR       JOHN J
OLIVER       CHARLIE
DOE FAHLER   JANE

You may use a list of Prefixes / Suffixes and run your data against them (hoping for the best)
 

Part and Inventory Search

Sponsor

Back
Top