llmclaughlin
Programmer
I have a DataTable thats created from a file I read in. One of the columns in the table is for Name. When I read the table I'm creating a new file in a different file format. The name field in my table is formatted as Smith, John E. For the new file that I'm creating I need to break it out by last name, first name, and middle name. The questions is how can I do that. The below code is how I'm reading the table and the Name rows contains the full name.
With dsXTemp
For i = 0 To .Rows.Count - 1
sr.WriteLine(.Rows(i).Item("ID").ToString.PadRight(15) & _
.Rows(i).Item("Name").ToString.PadRight(25) & _
.Rows(i).Item("Name").ToString.PadRight(15) & _
.Rows(i).Item("Name").ToString.PadRight(1) & _
.Rows(i).Item("Cell").ToString.PadRight(20) & _
.Rows(i).Item("EndBal").ToString.PadRight(8))
Next
End With
So the first row name would be last name, second row name would be first name, thried row name is middle. But all name rows have full name Smith,John E
Thanks
Louie
With dsXTemp
For i = 0 To .Rows.Count - 1
sr.WriteLine(.Rows(i).Item("ID").ToString.PadRight(15) & _
.Rows(i).Item("Name").ToString.PadRight(25) & _
.Rows(i).Item("Name").ToString.PadRight(15) & _
.Rows(i).Item("Name").ToString.PadRight(1) & _
.Rows(i).Item("Cell").ToString.PadRight(20) & _
.Rows(i).Item("EndBal").ToString.PadRight(8))
Next
End With
So the first row name would be last name, second row name would be first name, thried row name is middle. But all name rows have full name Smith,John E
Thanks
Louie