CsvEngineCsvToDataTable Method (String, String, Char, Boolean, Boolean) |
Reads a CSV File and return their contents as DataTable
Namespace:
FileHelpers
Assembly:
FileHelpers (in FileHelpers.dll) Version: 3.2.6
Syntaxpublic static DataTable CsvToDataTable(
string filename,
string classname,
char delimiter,
bool hasHeader,
bool ignoreEmptyLines
)
Public Shared Function CsvToDataTable (
filename As String,
classname As String,
delimiter As Char,
hasHeader As Boolean,
ignoreEmptyLines As Boolean
) As DataTable
Parameters
- filename
- Type: SystemString
The file to read. - classname
- Type: SystemString
The name of the record class - delimiter
- Type: SystemChar
The delimiter for each field - hasHeader
- Type: SystemBoolean
Indicates if the file contains a header with the field names. - ignoreEmptyLines
- Type: SystemBoolean
Indicates if blank lines in the file should not be included in the returned DataTable
Return Value
Type:
DataTableThe contents of the file as a DataTable
See Also