/// <summary>Reads a Csv File and return their contents as DataTable</summary> /// <param name="filename">The file to read.</param> /// <param name="options">The options used to create the record mapping class.</param> /// <returns>The contents of the file as a DataTable</returns> public static DataTable CsvToDataTable(string filename, CsvOptions options) { var engine = new CsvEngine(options); return engine.ReadFileAsDT(filename); }
/// <summary>Reads a Csv File and return their contents as DataTable</summary> /// <param name="classname">The name of the record class</param> /// <param name="delimiter">The delimiter for each field</param> /// <param name="filename">The file to read.</param> /// <param name="hasHeader">Indicates if the file contains a header with the field names.</param> /// <returns>The contents of the file as a DataTable</returns> public static DataTable CsvToDataTable(string filename, string classname, char delimiter, bool hasHeader) { return(CsvEngine.CsvToDataTable(filename, classname, delimiter, hasHeader)); }
/// <summary>Reads a Csv File and return their contents as DataTable</summary> /// <param name="filename">The file to read.</param> /// <param name="options">The options used to create the record mapping class.</param> /// <returns>The contents of the file as a DataTable</returns> public static DataTable CsvToDataTable(string filename, CsvOptions options) { return(CsvEngine.CsvToDataTable(filename, options)); }
/// <summary>Reads a Csv File and return their contents as DataTable (The file must have the field names in the first row)</summary> /// <param name="delimiter">The delimiter for each field</param> /// <param name="filename">The file to read.</param> /// <returns>The contents of the file as a DataTable</returns> public static DataTable CsvToDataTable(string filename, char delimiter) { return(CsvEngine.CsvToDataTable(filename, delimiter)); }
/// <summary>Simply dumps the DataTable contents to a delimited file. Only allows to set the delimiter.</summary> /// <param name="dt">The source Data Table</param> /// <param name="filename">The destination file.</param> /// <param name="options">The options used to write the file</param> public static void DataTableToCsv(DataTable dt, string filename, CsvOptions options) { CsvEngine.DataTableToCsv(dt, filename, options); }
/// <summary>Simply dumps the DataTable contents to a delimited file. Only allows to set the delimiter.</summary> /// <param name="dt">The source Data Table</param> /// <param name="filename">The destination file.</param> /// <param name="delimiter">The delimiter used to write the file</param> public static void DataTableToCsv(DataTable dt, string filename, char delimiter) { CsvEngine.DataTableToCsv(dt, filename, new CsvOptions("Tempo", delimiter, dt.Columns.Count)); }
/// <summary>Simply dumps the DataTable contents to a delimited file using a ',' as delimiter.</summary> /// <param name="dt">The source Data Table</param> /// <param name="filename">The destination file.</param> public static void DataTableToCsv(DataTable dt, string filename) { CsvEngine.DataTableToCsv(dt, filename); }
/// <summary>Reads a Csv File and return their contents as DataTable</summary> /// <param name="filename">The file to read.</param> /// <param name="options">The options used to create the record mapping class.</param> /// <returns>The contents of the file as a DataTable</returns> public static DataTable CsvToDataTable(string filename, CsvOptions options) { var engine = new CsvEngine(options); return(engine.ReadFileAsDT(filename)); }