Click or drag to resize

CsvEngine Class

A class to read generic CSV files delimited for any char.
Inheritance Hierarchy
SystemObject
  FileHelpersEngineBase
    FileHelpersEventEngineBaseObject
      FileHelpersFileHelperEngineObject
        FileHelpersFileHelperEngine
          FileHelpersCsvEngine

Namespace:  FileHelpers
Assembly:  FileHelpers (in FileHelpers.dll) Version: 3.2.6
Syntax
public sealed class CsvEngine : FileHelperEngine

The CsvEngine type exposes the following members.

Constructors
  NameDescription
Public methodCsvEngine(CsvOptions)
Create a CsvEngine using the specified sample file with their headers.
Public methodCsvEngine(String, Char, Int32)

Create a CsvEngine using the specified number of fields.

With this constructor will ignore the first line of the file. Use CsvOptions overload.

Public methodCsvEngine(String, Char, String)

Create a CsvEngine using the specified sample file with their headers.

With this constructor will ignore the first line of the file. Use CsvOptions overload.

Top
Properties
  NameDescription
Public propertyEncoding
The encoding to Read and Write the streams. Default is the system's current ANSI code page.
(Inherited from EngineBase.)
Public propertyErrorManager
This is a common class that manages the errors of the library.
(Inherited from EngineBase.)
Public propertyErrorMode
Indicates the behavior of the engine when it finds an error. {Shortcut for )
(Inherited from EngineBase.)
Public propertyFooterText
The Read Footer in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyHeaderText
The Read Header in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyLineNumber
The current line number.
(Inherited from EngineBase.)
Public propertyNewLineForWrite
Newline string to be used when engine writes to file. Default is the system's newline setting (System.Environment.NewLine).
(Inherited from EngineBase.)
Public propertyOptions
Allows you to change some record layout options at runtime
(Inherited from EngineBase.)
Public propertyRecordType
Returns the type of records handled by this engine.
(Inherited from EngineBase.)
Public propertyTotalRecords
The total numbers of records in the last read/written file (only works with whole read/write).
(Inherited from EngineBase.)
Top
Methods
  NameDescription
Public methodCode exampleAppendToFile(String, IEnumerableT)
Append an array of records to the specified file.
(Inherited from FileHelperEngineT.)
Public methodCode exampleAppendToFile(String, T)
Append a record to the specified file.
(Inherited from FileHelperEngineT.)
Public methodStatic memberCsvToDataTable(String, CsvOptions)
Reads a CSV File and return their contents as DataTable
Public methodStatic memberCsvToDataTable(String, Char)
Reads a CSV File and return their contents as DataTable (The file must have the field names in the first row)
Public methodStatic memberCsvToDataTable(String, String, Char)
Reads a CSV File and return their contents as DataTable (The file must have the field names in the first row)
Public methodStatic memberCsvToDataTable(String, String, Char, Boolean)
Reads a CSV File and return their contents as DataTable
Public methodStatic memberCsvToDataTable(String, String, Char, Boolean, Boolean)
Reads a CSV File and return their contents as DataTable
Public methodStatic memberDataTableToCsv(DataTable, String)
Simply dumps the DataTable contents to a delimited file using a ',' as delimiter.
Public methodStatic memberDataTableToCsv(DataTable, String, CsvOptions)
Simply dumps the DataTable contents to a delimited file. Only allows to set the delimiter.
Public methodStatic memberDataTableToCsv(DataTable, String, Char)
Simply dumps the DataTable contents to a delimited file using delimiter as delimiter.
Public methodGetFileHeader
Builds a line with the name of the fields, for a delimited files it uses the same delimiter, for a fixed length field it writes the fields names separated with tabs
(Inherited from EngineBase.)
Public methodCode exampleReadFile(String)
Read a file and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadFile(String, Int32)
Read a file and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadFileAsDT(String) Obsolete.
Read the records of the file and fill a DataTable with them
(Inherited from FileHelperEngineT.)
Public methodReadFileAsDT(String, Int32) Obsolete.
Read the records of the file and fill a DataTable with them
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadFileAsList(String) Obsolete.
Read a file and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadFileAsList(String, Int32) Obsolete.
Read a file and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadStream(TextReader)
Read a Stream and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadStream(TextReader, Int32)
Read a Stream and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadStreamAsDT(TextReader) Obsolete.
Read the records of the stream and fill a DataTable with them
(Inherited from FileHelperEngineT.)
Public methodReadStreamAsDT(TextReader, Int32) Obsolete.
Read the records of the stream and fill a DataTable with them
(Inherited from FileHelperEngineT.)
Public methodCode exampleReadStreamAsList Obsolete.
Read a Stream and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadString(String)
Read a String and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadString(String, Int32)
Read a String and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadStringAsDT(String) Obsolete.
Read the records of a string and fill a DataTable with them.
(Inherited from FileHelperEngineT.)
Public methodReadStringAsDT(String, Int32) Obsolete.
Read the records of a string and fill a DataTable with them.
(Inherited from FileHelperEngineT.)
Public methodReadStringAsList(String) Obsolete.
Read a String and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodReadStringAsList(String, Int32) Obsolete.
Read a String and return an array of the contained records.
(Inherited from FileHelperEngineT.)
Public methodCode exampleWriteFile(String, IEnumerableT)
Write an array of records to the specified file.
(Inherited from FileHelperEngineT.)
Public methodCode exampleWriteFile(String, IEnumerableT, Int32)
Write the specified number of records from the array to a file.
(Inherited from FileHelperEngineT.)
Public methodCode exampleWriteStream(TextWriter, IEnumerableT)
Write an array of records to the specified Stream.
(Inherited from FileHelperEngineT.)
Public methodCode exampleWriteStream(TextWriter, IEnumerableT, Int32)
Write the specified number of records in the array to the Stream.
(Inherited from FileHelperEngineT.)
Public methodWriteString(IEnumerableT)
Write an array of records to an String and return it.
(Inherited from FileHelperEngineT.)
Public methodWriteString(IEnumerableT, Int32)
Write an array of records to an String and return it.
(Inherited from FileHelperEngineT.)
Top
Events
See Also