Skip to content

CsvParseOptions

ClassChartGuruChartGuru
public sealed class CsvParseOptions

Options for CsvParser.Parse(string, CsvParseOptions). Sensible defaults match the most common spreadsheet exports (RFC 4180 with auto-detected delimiter and header).

public char Delimiter

Field delimiter. ‘\0’ (default) auto-detects between ,, ;, \t, and |.

Returns

System.Char

public char Quote

Field quote character. RFC 4180 uses ”.

Returns

System.Char

public CsvHeaderMode HeaderMode

Header row treatment. CsvHeaderMode.Auto compares the first row with the rows below it: text above a column of numbers, dates or Booleans makes it a header, a number or date there makes it data, and a table of text only takes a first row without numbers as a header. Set to CsvHeaderMode.Yes / CsvHeaderMode.No to force.

Returns

ChartGuru.CsvHeaderMode

public CultureInfo NumberCulture

Culture whose number format the cells use, such as de-DE for 1.234,5. Null reads invariant numbers, taking a lone comma that is not followed by exactly three digits as a decimal comma (1,5) and other commas as thousands separators (1,234), and reads decimal commas throughout text delimited by semicolons.

Returns

System.Globalization.CultureInfo

public string CommentPrefix

Lines starting with this prefix are skipped before parsing. Empty disables.

Returns

System.String

public int SkipRows

Number of physical lines to skip at the top of the file.

Returns

System.Int32

public int MaxRows

Maximum data rows to retain (0 = unlimited).

Returns

System.Int32

public bool TrimCells

Trim whitespace from every parsed cell.

Returns

System.Boolean

public CsvParseOptions Clone()

Creates an independent copy of this Csv Parse Options; later configuration changes do not affect the original instance.

Returns

ChartGuru.CsvParseOptions

public CsvParseOptions()