separate field into parts (1 Viewer)

deekras

Registered User.
Local time
Today, 14:07
Joined
Jun 14, 2000
Messages
169
i have a name field that includes a first middle (or initial) last and sometimes a rank (jr, sr. III). I want to separate the field into 4 fields. My problem is that only some have rank, so i am having a problem with the last name.

first
middle
last
rank

how do i do that?
 

llkhoutx

Registered User.
Local time
Today, 08:07
Joined
Feb 26, 2001
Messages
4,018
Use the Instr function.

First search for a ","; to tthe right is a space and your forth field. If no comma, no fourth field.

Then search for last space (before the comma) and the 3rd field is to the right.

Then search from the front for spaces, etc.

Unpacking names is frought with problems: what if no middle name, what if first name is unknown, middle initial may be used instead of middle name, rank may not be separated by a comma to name a few.
 

deekras

Registered User.
Local time
Today, 14:07
Joined
Jun 14, 2000
Messages
169
you are right, the rank is nor always separated by a comma. but the rank is always either Jr or Jr. or Sr. or Sr or III or II. Can I do anything with that?
 

Users who are viewing this thread

Top Bottom