Name parsing routine



I'm looking for some input on the best way to accomplish this. I have a data
extract from Outlook that I'm parsing to go into a SQL table. I need to take
a Full name and put it into 6 fields. PrimaryFirst, PrimaryMiddle,
PrimaryLast, SecondaryFirst, SecondaryMiddle, SecondaryLast.

90% of the names fall into the following patterns:

FirstName Lastname
'Joe Anderson
FirstName MiddleName Lastname 'Joe
J. Anderson
Prefix FirstName MiddleName LastName 'Mr. Joe
J. Anderson
Prefix FirstName MiddleName LastName Suffix 'Mr. Joe
J. Anderson Jr.
FirstName and/& SecFirstName LastName 'Joe &
Jane Anderson
FirstName and/& SecFirstName LastName Suffix 'Joe & Jane
Anderson Jr.
Prefix FirstName and/& SecFirstName LastName 'Mr. Joe &
Jane Anderson
Prefix FirstName and/& SecFirstName MiddleName LastName 'Mr. Joe & Jane J.
Anderson
Prefix FirstName and/& SecFirstName LastName Suffix 'Mr Joe &
Jane Anderson Jr.
Prefix FirstName and/& SecFirstName MiddleName LastName Suffix 'Mr Joe &
Jane J. Anderson Jr.
Prefix FirstName and/& Prefix SecFirstName LastName 'Mr. Joe &
Mrs. Jane Anderson
Prefix and/& Prefix Firstname LastName 'Mr &
Mrs. Joe Anderson
Prefix and/& Prefix Firstname MiddleName LastName 'Mr & Mrs.
Joe J. Anderson
Prefix and/& Prefix Firstname MiddleName LastName Suffix 'Mr & Mrs. Joe
J. Anderson Jr.

I've decided that I'm going to drop all Prefixes and Append any Suffixes to
the Lastname field. I already have quite a bit of code, but it's getting
convoluted and messy at this point and I want to clean it up. Right now, I'm
just working with text files and writing the fields back to a new text file
after parsing. I'm really just trying to brainstorm on the most efficient
way to code the parsing routine/s. The way I'm doing it now isn't getting
all cases.

TIA

Matt


.



Relevant Pages

  • Re: Name parsing routine
    ... ' Tests whether the next element is a known prefix ... AnalyseName "Joe Anderson" ...
    (microsoft.public.vb.general.discussion)
  • Re: Name parsing routine
    ... 'Joe Anderson ... Prefix FirstName and/& SecFirstName MiddleName LastName 'Mr. Joe & Jane ... Jane Anderson Jr. ...
    (microsoft.public.vb.general.discussion)
  • Re: Name parsing routine
    ... I just noticed that names with a prefix, a first and lastname with no middle ... Name Specification = Mr. Joe Anderson ... ' middlename = name | initial. ...
    (microsoft.public.vb.general.discussion)
  • Re: Name parsing routine
    ... FirstName Lastname 'Joe Anderson ... Prefix FirstName MiddleName LastName ... 'Joe & Jane Anderson ...
    (microsoft.public.vb.general.discussion)
  • Re: Name parsing routine
    ... ' Tests whether the next element is a known prefix ... AnalyseName "Joe Anderson" ...
    (microsoft.public.vb.general.discussion)

Loading