separating names
Im trying to Separate Last name, First Name and Middle Initial. File is csv format, here is an example:
A0001,3,Y,13,LU,
A0001,3,Y,13,CLARK P,
A0001,3,Y,13,SMITH JOHN,
A0001,3,开发者_如何转开发Y,13,BEAL KRISS J,
A0001,3,Y,13,THOMAS A CLIFF C,
A0001,3,Y,13,DEW III ROBERT H,
Output fields :
Last name First name Initial
LU
CLARK P
SMITH JOHN
BEAL KRISS J
THOMAS A CLIFF C
DEW III ROBERT H
I hope someone can help with VB script maybe? Thanks in advance.
- First split on coma and get the name part seperated.
- Now on the name part, split using space and take
- the last element as last name
- second last element as middle name
- and the rest as first name.
Hope this helps,
Happy Programming...
Use Split()
on each line. That will give you an array, split on a delimiter... in this case, a comma.
http://msdn.microsoft.com/en-us/library/6x627e5f(VS.80).aspx
精彩评论