Hi. I have a Text file that looks something like this:
So whereCode:"157548","asdf","ASDF","F","243","2/19/1993","(H)------","","Teams:","Emergency Contacts: (Uncle)-----(H)9----- (W)----- (C)------,"ENG2D1-05","460977"
"," is, How would I end up splitting them?
I tried something like this:
vb Code:
Public Sub ImportList() With frmOverview If .ofdImport.ShowDialog = DialogResult.OK Then Dim OFDName As String = .ofdImport.FileName MsgBox(.ofdImport.FileName) Dim FS As New FileStream(OFDName, FileMode.Open, FileAccess.Read) Dim SR As New StreamReader(FS) SR.BaseStream.Seek(0, SeekOrigin.Begin) While SR.Peek() > -1 Dim ChrArr() As String = {SR.ReadLine} SR.ReadLine() For i As Integer = 0 To SR.EndOfStream Dim ChrArrSplit() As String = ChrArr(i).Split(",") ChrArr(i) = SR.ReadLine Next i End While End If End With End Sub
But it only ended up splitting the CourseCode ("157548")




Reply With Quote