Hi,
Can somebody provide me code to seperate first name and middle initial.
Currently they are in the same field.Some examples are as follows
Cari A
Michael A C
Leslie Marc
Kuan-Yu
Cielo Patricia
Renee (Johnson) M
Gary D Sr
It should be like first name:cari
middle initial:A
First name:cielo
middle initial:p
Thanx in advance.
Name Seperation
Moderators: chulett, rschirm, roy
What would be the Middle name in case of
Michael A C
Leslie Marc
Kuan-Yu
Renee (Johnson) M
Gary D Sr ?
What is the metadata of your Middle name. CHAR(1)? If you can play around with CAPITALS built in transform and the Field Function you might be get near to it.
Michael A C
Leslie Marc
Kuan-Yu
Renee (Johnson) M
Gary D Sr ?
What is the metadata of your Middle name. CHAR(1)? If you can play around with CAPITALS built in transform and the Field Function you might be get near to it.
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Assuming that you want everything ahead of the first space character, and everything after the first space character, then the Field() function is what you need.
Code: Select all
Field(TheString, " ", 1, 1)
TrimF(Field(TheString, " ", 2, 99999))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.