public readonly record struct CsvMalformedRecord(long RecordNumber, CsvMalformedReason Reason, bool Skipped, long ByteOffset, string RawRecord, long LineNumber = 0)
Namespace
CsvHelper
Assembly
CsvHelper.dll
Builds
net10.0 netstandard2.1 netstandard2.0 net47

Constructors

public CsvMalformedRecord(long RecordNumber, CsvMalformedReason Reason, bool Skipped, long ByteOffset, string RawRecord, long LineNumber = 0)

Describes a malformed record passed to CsvReaderOptions.OnMalformedRecord.

Parameters

RecordNumberlong
The 1-based number of the record, counting the header and the records returned before it (not skipped records, empty lines or comments), as in CsvFormatException.RecordNumber.
ReasonCsvMalformedReason
What is wrong with the record. A record with several quoting problems is reported once, with the first one.
Skippedbool
Whether the reader skips the record (CsvMalformedDataHandling.Skip, or a field count mismatch); otherwise it recovers and returns the record.
ByteOffsetlong
The offset, in bytes of UTF-8 input, of the problem (malformed quoting) or of the start of the record (field count mismatch).
RawRecordstring
The record as it appears in the input, without the line break.
LineNumberlong
The 1-based line of the input where the record starts, counting every line (also those inside quoted fields), when CsvReaderOptions.TrackLineNumbers is on; 0 otherwise.

View source

Properties

ByteOffset

Added in v34.0.0
public long ByteOffset { get; init; }

The offset, in bytes of UTF-8 input, of the problem (malformed quoting) or of the start of the record (field count mismatch).

Property value

long

View source

RawRecord

Added in v34.0.0
public string RawRecord { get; init; }

The record as it appears in the input, without the line break.

Property value

string

View source

RecordNumber

Added in v34.0.0
public long RecordNumber { get; init; }

The 1-based number of the record, counting the header and the records returned before it (not skipped records, empty lines or comments), as in CsvFormatException.RecordNumber.

Property value

long

View source