Hi Curtis,
A crude but fairly effective approach that works for most traditional
American names is:
1 Assume that everything up to the first space is the first name.
2 If there are no other spaces, the remainder is the last name.
3 If there are spaces, check for particles such as "de", "de la", "van",
"van der" and so on. If the remainder fits one of these patterns, assume
it's the last name. If it doesn't, move on to the next space and loop
back to 2.
4 Assume that everything between the first space and the beginning of
the last name is the middle name.
To do much better than this means a *lot* of programming. Consider using
a commercial tool such as Splitter For Microsoft Access
http://www.infoplan.com.au/splitter/. This isn't perfect (as I said,
nothing can be) but at least someone else has done the hard work<g>.
The problem is that you can't trust people to have names that fit the
pattern:
Pierre Joseph Marie Teilhard de Chardin
Boutros Boutros Ghali
Emmanuel Le Roy Ladurie
J. Edgar Hoover
Laurens Van Der Post
Sitting Bull
to name but a few. And there are billions of people in the world (the
majority, as far as I know) whose names don't fit the traditional
American "first middle last" pattern at all: for instance all the places
where the family name is put first and the personal name(s) last.
In addition, there are names that are written identically but parse
differently:
Mary Patrick Henry (daughter of devoutly Catholic
Mr & Mrs Henry, Patrick is middle name)
Mary Patrick Henry (family name is "Patrick Henry", let's
not ask why)
So there's no possibility of writing code that can do this job
perfectly.