Re: Name parsing routine




I had to do something like that a while back. It was to prepare test
data. It seemed that the complexity of preparing the test data was
greater than that of the application that was going to use it :-S

I never finished the routine and ended up cutting down on test
data and doing most of the tweaking by hand. I do recall that
one of my ideas was to break the code down into simpler and
smaller functions where each one would have a specific job, like
removing titles, locating middle initials, removing suffixes and
so on. I woul dtake the name and pass it to each of these function,
where each one would process the name a certain way.

Another routine would then split the remaining name and try
to group and categorize names into first, middle and last. Since
these were individuals' names, I did not have to cope with a
secondary name, bit since the name had no order, I had to
try and determine whether the first text corresponded to
a first or last name (luckily the use of the coma was standard).

I am sorry that I can't be more helpful, I guess this post was
meant to be supportive, since I feel your pain.

Good luck with your project.
Saga


"Matt Williamson" <ih8spam@xxxxxxxxxxx> wrote in message
news:epqhqC7bGHA.380@xxxxxxxxxxxxxxxxxxxxxxx
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
    ... ' Tests whether the next element is a known prefix ... AnalyseName "Joe 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)