Newbies cjbright Posted May 11, 2001 Newbies Posted May 11, 2001 I have a field called "Name" which contains, as you might imagine, names. It unfortunately holds both first and last names, all of varying character lengths and separated by a space. I am trying to write a script that will separate them into two fields, "Firstname" and "Lastname", and remove the space. I anticipate using the "Set Field" script step but don't know how to go about writing the calculation. Does anyone have some advise on this?
markpro Posted May 11, 2001 Posted May 11, 2001 Create a field called "First Name". Find all records, and use the Replace command to replace with calculation, the calculation being: Leftwords(Name,1) The same will be done for "Last Name". Replace, the calculation being: Rightwords(Name,1)
BobWeaver Posted May 11, 2001 Posted May 11, 2001 Beware of situations where the name field has more than a single first name and single last name. Eg: Ludwig Von Beethoven George W. Bush Henry Ford II etc. Create a calculated field called NameWordCount and set it equal to WordCount(Name). Then do a search for NameWordCount>2. This will give you a found set of problem records that you will have to handle differently.
Recommended Posts
This topic is 8601 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now