C# Класс Mono.Csv.CsvFileReader

Class for reading from comma-separated-value (CSV) files
Наследование: CsvFileCommon, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CsvFileReader ( Stream stream, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System

Initializes a new instance of the CsvFileReader class for the specified stream.

CsvFileReader ( StreamReader reader, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System

Initializes a new instance of the CsvFileReader class for the specified stream.

CsvFileReader ( string path, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System

Initializes a new instance of the CsvFileReader class for the specified file path.

Dispose ( ) : void
ReadAll ( string path, Encoding encoding ) : List>
ReadAll ( List dataGrid ) : bool
ReadRow ( List columns ) : bool

Reads a row of columns from the current CSV file. Returns false if no more data could be read because the end of the file was reached.

Приватные методы

Метод Описание
ReadQuotedColumn ( ) : string

Reads a quoted column by reading from the current line until a closing quote is found or the end of the file is reached. On return, the current position points to the delimiter or the end of the last line in the file. Note: CurrLine may be set to null on return.

ReadUnquotedColumn ( ) : string

Reads an unquoted column by reading from the current line until a delimiter is found or the end of the line is reached. On return, the current position points to the delimiter or the end of the current line.

Описание методов

CsvFileReader() публичный Метод

Initializes a new instance of the CsvFileReader class for the specified stream.
public CsvFileReader ( Stream stream, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System
stream Stream The stream to read from
emptyLineBehavior EmptyLineBehavior Determines how empty lines are handled
Результат System

CsvFileReader() публичный Метод

Initializes a new instance of the CsvFileReader class for the specified stream.
public CsvFileReader ( StreamReader reader, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System
reader System.IO.StreamReader
emptyLineBehavior EmptyLineBehavior Determines how empty lines are handled
Результат System

CsvFileReader() публичный Метод

Initializes a new instance of the CsvFileReader class for the specified file path.
public CsvFileReader ( string path, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns ) : System
path string The name of the CSV file to read from
emptyLineBehavior EmptyLineBehavior Determines how empty lines are handled
Результат System

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

ReadAll() публичный статический Метод

public static ReadAll ( string path, Encoding encoding ) : List>
path string
encoding System.Text.Encoding
Результат List>

ReadAll() публичный Метод

public ReadAll ( List dataGrid ) : bool
dataGrid List
Результат bool

ReadRow() публичный Метод

Reads a row of columns from the current CSV file. Returns false if no more data could be read because the end of the file was reached.
public ReadRow ( List columns ) : bool
columns List Collection to hold the columns read
Результат bool