Class SunamoCsvReader
- Namespace
- SunamoCsv
- Assembly
- SunamoCsv.dll
Používat CsvFile místo toho Class to read csv content from various sources Downloaded from http://www.codeproject.com/Articles/86973/C-CSV-Reader-and-Writer
public sealed class SunamoCsvReader : IDisposable
- Inheritance
-
SunamoCsvReader
- Implements
- Inherited Members
- Extension Methods
Constructors
SunamoCsvReader(Stream)
Initialises the reader to work from an existing stream
public SunamoCsvReader(Stream stream)
Parameters
streamStreamStream
SunamoCsvReader(Stream, Encoding?)
Initialises the reader to work from an existing stream
public SunamoCsvReader(Stream stream, Encoding? encoding)
Parameters
SunamoCsvReader(string)
Initialises the reader to work from a file
public SunamoCsvReader(string filePath)
Parameters
filePathstringFile path
SunamoCsvReader(string, Encoding?)
Initialises the reader to work from a file
public SunamoCsvReader(string filePath, Encoding? encoding)
Parameters
SunamoCsvReader(Encoding?, string)
Initialises the reader to work from a csv string
public SunamoCsvReader(Encoding? encoding, string csvContent)
Parameters
Properties
Delimiter
Gets or sets the delimiter character used to separate fields in CSV files (default: comma)
public static char Delimiter { get; set; }
Property Value
FieldCount
Gets the field count or returns null if no fields have been read
public int? FieldCount { get; }
Property Value
- int?
Fields
Returns a collection of fields or null if no record has been read
public List<string>? Fields { get; }
Property Value
HasHeaderRow
Gets or sets whether the csv file has a header row
public bool HasHeaderRow { get; set; }
Property Value
TrimColumns
Gets or sets whether column values should be trimmed
public bool TrimColumns { get; set; }
Property Value
Methods
DateTime(CsvFile, int)
Use CsvFile.DateTimes instead
public static List<DateTime?> DateTime(CsvFile file, int columnIndex)
Parameters
Returns
Dispose()
Disposes of all unmanaged resources
public void Dispose()
ReadIntoDataTable()
Reads a csv file format into a data table. This method will always assume that the table has a header row as this will be used to determine the columns.
public DataTable ReadIntoDataTable()
Returns
ReadIntoDataTable(Type[])
Reads a csv file format into a data table. This method will always assume that the table has a header row as this will be used to determine the columns.
public DataTable ReadIntoDataTable(Type[] columnTypes)
Parameters
columnTypesType[]Array of column types
Returns
ReadNextRecord()
Reads the next record
public bool ReadNextRecord()
Returns
- bool
True if a record was successfuly read, otherwise false
Strings(CsvFile, int)
Returns string values from specified column (use CsvFile.Strings instead)
public static List<string> Strings(CsvFile file, int columnIndex)