I have a file of members in excel with al the details in 1 field like this:


how can i split them in firstname, lastname, full email adress, membergroup so i can insert them in my table tblMembers?


It could be done simply with VB.NET's Split method

Dim OneLine As String = "fristname.lastname@emailadress.com,,,,,,membergroup"
Dim SplittedLine() As String

' Split the whole string
SplittedLine = Strings.Split(OneLine, ",")
' Email address is now SplittedLine(0) and so on...

' Get first and last name
Dim Temp() As String

' First remove domain part
Temp = Strings.Split(SplittedLine(0), "@")

Dim Name() As String

' Finally, separate first and last name
Name = Strings.Split(Temp(0), ".")
' First name is in Name(0) and the last name is in Name(1)

Add proprietary error handling and "sanity" checks. The code blows if it encounters differently formatted data than expected ;)