Dim sr As New StreamReader(path) sr.ReadLine() 'skip the header line Dim sFileData As String = sr.ReadToEnd() sr.Close() sr.Dispose() Dim sLines As String() = sFileData.Split(ControlChars.Lf) Dim dtRecs As New DataTable() Dim sArray As String() = sLines(0).Split(","c) For Each s As String In sArray dtRecs.Columns.Add(New DataColumn()) Next Dim row As DataRow Dim sLastLine As String = "" For Each ss As String In sLines If ss.Length > 0 Then row = dtRecs.NewRow() sLastLine = ss.Replace(Convert.ToString(ControlChars.Cr), "") row.ItemArray = sLastLine.Split(","c) dtRecs.Rows.Add(row) End If Next
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.