Description
The CsvReader class allows you to create a reader of CSV streams.
Constructors
Constructs this object with text reader.
publicCsvReader(TextReader reader, char[] fieldSeparators, char[] quoteSymbols, string endOfLine)
- reader: TextReader - text reader to read the CSV data.
- fieldSeparators: char[] - separators for fields in CSV stream.
- quoteSymbols: char[] - characters to quote strings.
- endOfLine: end of line.
Constructs this object with string buffer.
publicCsvReader(TextReader reader, char[] fieldSeparators, char[] quoteSymbols)
- reader: TextReader - text reader to read the CSV data.
- fieldSeparators: char[] - separators for fields in CSV stream.
- quoteSymbols: char[] - characters to quote strings.
Constructs this object with string buffer.
publicCsvReader(string buffer, char[] fieldSeparators, char[] quoteSymbols)
- buffer: string - text reader to read the CSV data.
- fieldSeparators: char[] - separators for fields in a CSV stream.
- quoteSymbols: char[] - characters to quote strings.
Constructs this object with string buffer.
publicCsvReader(string buffer, char[] fieldSeparators, char[] quoteSymbols, string endOfLine)
- reader: string - text reader to read the CSV data.
- fieldSeparators: char[] - separators for fields in a CSV stream.
- quoteSymbols: char[] - characters to quote strings.
- endOfLine: string - end of line
Properties
EndOfLine
Separator for rows in CSV stream. Default is “\r\n”.
publicstring EndOfLine { get; }
Eof
Flag that shows end of CSV stream.
publicbool Eof { get; }
Eol
Flag that shows enf of line in CSV stream;
publicbool Eol { get; }
FieldSeparators
Separators for fields in CSV stream. Default is comma (,).
publicchar[] FieldSeparators { get; }
Length
Characters to quote strings in CSV streams. Default is double quote (").
publicchar[] QuoteSymbols { get; }
Instance methods
ReadField
Reads the next field from the CSV stream and sets EOL and OEF flags. It returns String.Empty for null string or in a case of EOF.
publicstring ReadField()
- returns: string - returns String.Empty for null string or in a case of EOF.
SkipLine
It skips one line
publicvoid SkipLine()