LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Parsing names

I am working with strings that have the following format:

<last name [title] <first name [middle initial] 0000

(The [title] and [middle] are optional, so they might or
might not occur in a string! The title is usually "Jr." or
"Sr" or "III" or "II". Middle initial is only ONE character)

Here are some examples:

myVar = "Jones Jim R 0000"
myVar = "Filbert III Bobby 0000"
myVar = "Smith Jr James F 0000"
myVar = "Milton Brad 0000"

Can anyone think of a good strategy for parsing each of
the name tokens into their own variables?? I have 4 variables
named "myLast", "myTitle", "myFirst" and "myMiddle" where
I would like to store each token. What makes this difficult
is that the title and middle initial are optional and may not
exist in a string.

I'd appreciate any help here.

(BTW, assume that the data will be formatted exactly as
above with just one space between each token. There
also wont be any oddball situations, like an empty string)

Thanks!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another Method for Parsing Names Jim Berglund[_2_] Excel Programming 1 October 18th 07 08:00 PM
Parsing names from one column into 3. Kevin Porter Excel Programming 5 August 25th 07 12:54 PM
parsing full names in to 3 columns me[_10_] Excel Programming 9 March 11th 06 09:57 PM
Formulas for Parsing Full names jonefer Excel Worksheet Functions 3 February 14th 06 06:28 AM
Parsing Full Names of varying lenths and parts Dan Excel Programming 1 October 24th 03 06:26 PM


All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"