Class FixedWidthExtractorOptions<TRecord>

Namespace
Wolfgang.Etl.FixedWidth
Assembly
Wolfgang.Etl.FixedWidth.dll

Configuration for a FixedWidthExtractor<TRecord>, supplied to its constructor. Carries every parsing setting that is independent of the input shape; the Stream constructors take the derived FixedWidthExtractorStreamOptions<TRecord>, which adds the byte-decoding Encoding a TextReader caller has already decided.

public record FixedWidthExtractorOptions<TRecord> : ExtractorOptions, IEquatable<ExtractorOptions>, IEquatable<FixedWidthExtractorOptions<TRecord>> where TRecord : notnull

Type Parameters

TRecord

The record type the extractor produces.

Inheritance
ExtractorOptions
FixedWidthExtractorOptions<TRecord>
Implements
IEquatable<ExtractorOptions>
Derived
Inherited Members
ExtractorOptions.ToString()
ExtractorOptions.GetHashCode()
ExtractorOptions.Equals(ExtractorOptions)
ExtractorOptions.<Clone>$()
ExtractorOptions.EqualityContract
ExtractorOptions.ReportingInterval
ExtractorOptions.MaximumItemCount
ExtractorOptions.SkipItemCount
ExtractorOptions.ErrorPolicy

Remarks

Every property is init-only: settle the configuration before a run rather than mutating it during one (ADR-0009). The documented defaults live on the property initializers, so no constructor can diverge from them; a null options argument means "all defaults". Members that reject a value do so from the init accessor, so an invalid record cannot be constructed.

Properties

BlankLineHandling

How a blank line is handled. Defaults to ThrowException.

public BlankLineHandling BlankLineHandling { get; init; }

Property Value

BlankLineHandling

FieldDelimiter

The delimiter present between fields in the source, accounted for when computing field positions. Defaults to null (no delimiter).

public string? FieldDelimiter { get; init; }

Property Value

string

FieldSeparator

When non-null, the line after the last header line is treated as a separator and skipped. Only its presence matters, not its value. Defaults to null.

public char? FieldSeparator { get; init; }

Property Value

char?

HeaderLineCount

The number of header lines skipped before the first record. Defaults to 0.

public int HeaderLineCount { get; init; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

The value is negative.

LineFilter

Decides, per line, whether it is processed, skipped, or ends extraction. Defaults to a filter that processes every line.

public Func<string, LineAction> LineFilter { get; init; }

Property Value

Func<string, LineAction>

Exceptions

ArgumentNullException

The value is null.

MalformedLineHandling

How a line whose length does not match the schema is handled. Defaults to ThrowException.

public MalformedLineHandling MalformedLineHandling { get; init; }

Property Value

MalformedLineHandling

OnError

Optional callback invoked for each recoverable error. Defaults to null.

public Action<FixedWidthError>? OnError { get; init; }

Property Value

Action<FixedWidthError>

RecordValidator

Optional validation applied to each parsed record before it is yielded. Defaults to null (no validation).

public Func<TRecord, ValidationResult>? RecordValidator { get; init; }

Property Value

Func<TRecord, ValidationResult>

Schema

An explicit schema overriding the attribute-derived layout of TRecord. Defaults to null.

public FixedWidthSchema? Schema { get; init; }

Property Value

FixedWidthSchema

StartByteOffset

The byte offset to seek to before extraction begins — a checkpoint from a prior run. Defaults to 0.

public long StartByteOffset { get; init; }

Property Value

long

Exceptions

ArgumentOutOfRangeException

The value is negative.

TrackByteOffset

Whether byte offsets are tracked so a run can be checkpointed and resumed. Requires a seekable Stream source. Defaults to false.

public bool TrackByteOffset { get; init; }

Property Value

bool

ValueParser

Converts a field's text to the property's CLR type. Defaults to DefaultParser.

public FixedWidthValueParser ValueParser { get; init; }

Property Value

FixedWidthValueParser

Exceptions

ArgumentNullException

The value is null.