Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
 /// <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));
 }
Exemplo n.º 4
0
 /// <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));
 }
Exemplo n.º 5
0
 /// <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);
 }
Exemplo n.º 6
0
 /// <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));
 }
Exemplo n.º 7
0
 /// <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);
 }
Exemplo n.º 8
0
        /// <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));
        }