Jump to content

Dividing one text field into two


This topic is 8357 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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?

Link to comment
Share on other sites

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)

smile.gif" border="0

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 8357 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.