
Convert Delimited Text File to DataTable
The following code converts a delimited text file to a DataTable: Private Function CreateDataTable(ByVal path As String, ByVal headers As Boolean, ByVal delimiter As Char) As DataTable Dim dt As DataTable = New DataTable() If Not IO.File.Exists(path) Then Return Nothing End If Dim lines As List(Of String) = IO.File.ReadAllLines(path).ToList() If