C# Class CoreTechs.Common.Text.CsvParsingExtensions

Datei anzeigen Open project: Core-Techs/Common

Public Methods

Method Description
ReadCsv ( this reader, char delimiter = ',', char textQualifier = '"' ) : IEnumerable

Parses delimited text.

This implementation is simple and performs reasonably well. For more features or better performance, CsvHelper is recommended: https://www.nuget.org/packages/CsvHelper/

ReadCsvWithHeader ( this reader, StringComparer fieldKeyComparer = null, char delimiter = ',', char textQualifier = '"' ) : IEnumerable

Parses delimited text. The first row of data should be a header record containing the names of the fields in the following records.

This implementation is simple and performs reasonably well. For more features or better performance, CsvHelper is recommended: https://www.nuget.org/packages/CsvHelper/

Private Methods

Method Description
PreYieldResult ( ICollection data ) : string[]
ShouldYield ( IList result ) : bool
Skip ( this r, int n = 1 ) : void

Method Details

ReadCsv() public static method

Parses delimited text.
This implementation is simple and performs reasonably well. For more features or better performance, CsvHelper is recommended: https://www.nuget.org/packages/CsvHelper/
public static ReadCsv ( this reader, char delimiter = ',', char textQualifier = '"' ) : IEnumerable
reader this The source of character data to parse.
delimiter char The character that separates fields of data.
textQualifier char The character that surrounds field text that may contain the delimiter or the text qualifier itself. For literal occurrences of this character within the field data, the character should be doubled.
return IEnumerable

ReadCsvWithHeader() public static method

Parses delimited text. The first row of data should be a header record containing the names of the fields in the following records.
This implementation is simple and performs reasonably well. For more features or better performance, CsvHelper is recommended: https://www.nuget.org/packages/CsvHelper/
public static ReadCsvWithHeader ( this reader, StringComparer fieldKeyComparer = null, char delimiter = ',', char textQualifier = '"' ) : IEnumerable
reader this The source of character data to parse.
fieldKeyComparer StringComparer
delimiter char The character that separates fields of data.
textQualifier char The character that surrounds field text that may contain the delimiter or the text qualifier itself. For literal occurrences of this character within the field data, the character should be doubled.
return IEnumerable