Table of Contents

DelimitedReaderOptions Struct

Definition

Namespace
Bodu.Text.Delimited.Reader
Assembly
Bodu.Text.Delimited.dll
Package
Bodu.Text.Delimited 1.0.0
Source
DelimitedReaderOptions.cs

Provides configuration for a Utf8DelimitedReader, controlling the delimiter, quoting, header handling, and the field-count and duplicate-header policies.

public readonly struct DelimitedReaderOptions
Inherited Members
Extension Methods

Remarks

The options are an immutable value type. Because the default value of a char is '\0', the delimiter, quote, and comment characters fall back to their RFC 4180 defaults (',', '"', '#') when left unset, and headers are read by default (set NoHeader to disable).

Properties

AllowComments

Gets a value indicating whether lines beginning with the comment character are skipped.

public bool AllowComments { get; init; }

Property Value

bool

true to allow comment lines; otherwise false.

CommentChar

Gets the comment character, or '\0' to use the default '#'.

public char CommentChar { get; init; }

Property Value

char

The comment character.

Default

Gets the default reader options (comma delimiter, double-quote quoting, header row present).

public static DelimitedReaderOptions Default { get; }

Property Value

DelimitedReaderOptions

The default options.

Delimiter

Gets the field delimiter, or '\0' to use the default comma.

public char Delimiter { get; init; }

Property Value

char

The delimiter character.

DuplicateHeaderBehavior

Gets the policy applied to a header row that repeats a column name.

public DelimitedDuplicateHeaderBehavior DuplicateHeaderBehavior { get; init; }

Property Value

DelimitedDuplicateHeaderBehavior

The duplicate-header behavior.

FieldCountBehavior

Gets the policy applied to a record whose field count differs from the header's.

public DelimitedFieldCountBehavior FieldCountBehavior { get; init; }

Property Value

DelimitedFieldCountBehavior

The field-count behavior.

MalformedRecordBehavior

Gets the policy applied to a record that violates the field-count policy.

public DelimitedMalformedRecordBehavior MalformedRecordBehavior { get; init; }

Property Value

DelimitedMalformedRecordBehavior

The malformed-record behavior.

NoHeader

Gets a value indicating whether the first record is treated as data rather than a header row.

public bool NoHeader { get; init; }

Property Value

bool

true when there is no header; otherwise false.

Quote

Gets the quote character, or '\0' to use the default double quote.

public char Quote { get; init; }

Property Value

char

The quote character.

TrimFields

Gets a value indicating whether surrounding whitespace is trimmed from unquoted fields.

public bool TrimFields { get; init; }

Property Value

bool

true to trim fields; otherwise false.

Applies to

ProductVersions
.NET8, 10