Table of Contents

Class CsvReader

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Provides static methods for reading CSV data.

public static class CsvReader
Inheritance
object
CsvReader

Methods

Enumerate(in ReadOnlySequence<byte>, CsvOptions<byte>?)

Reads CSV records from the UTF8 CSV data.

public static CsvRecordEnumerable<byte> Enumerate(in ReadOnlySequence<byte> csv, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlySequence<byte>

CSV data to read

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvRecordEnumerable<byte>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(in ReadOnlySequence<char>, CsvOptions<char>?)

Reads CSV records from the CSV data.

public static CsvRecordEnumerable<char> Enumerate(in ReadOnlySequence<char> csv, CsvOptions<char>? options = null)

Parameters

csv ReadOnlySequence<char>

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(Stream, CsvOptions<byte>?, CsvIOOptions)

Reads CSV records from the UTF8 stream.

public static CsvRecordEnumerable<byte> Enumerate(Stream stream, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvRecordEnumerable<byte>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(Stream, CsvOptions<char>?, Encoding?, CsvIOOptions)

Reads CSV records from the stream using the specified encoding.

public static CsvRecordEnumerable<char> Enumerate(Stream stream, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(TextReader, CsvOptions<char>?, CsvIOOptions)

Reads CSV records from the text reader.

public static CsvRecordEnumerable<char> Enumerate(TextReader reader, CsvOptions<char>? options = null, CsvIOOptions ioOptions = default)

Parameters

reader TextReader

TextReader to read the CSV data from

options CsvOptions<char>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(ReadOnlyMemory<byte>, CsvOptions<byte>?)

Reads CSV records from the UTF8 CSV data.

public static CsvRecordEnumerable<byte> Enumerate(ReadOnlyMemory<byte> csv, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlyMemory<byte>

CSV data to read

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvRecordEnumerable<byte>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(ReadOnlyMemory<char>, CsvOptions<char>?)

Reads CSV records from the CSV data.

public static CsvRecordEnumerable<char> Enumerate(ReadOnlyMemory<char> csv, CsvOptions<char>? options = null)

Parameters

csv ReadOnlyMemory<char>

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(string?, CsvOptions<char>?)

Reads CSV records from the CSV data.

public static CsvRecordEnumerable<char> Enumerate(string? csv, CsvOptions<char>? options = null)

Parameters

csv string

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Enumerate(StringBuilder?, CsvOptions<char>?)

Reads CSV records from the CSV data.

public static CsvRecordEnumerable<char> Enumerate(StringBuilder? csv, CsvOptions<char>? options = null)

Parameters

csv StringBuilder

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

EnumerateFromFile(string, CsvOptions<byte>?, CsvIOOptions)

Reads CSV records from the specified file.

public static CsvRecordEnumerable<byte> EnumerateFromFile(string path, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvRecordEnumerable<byte>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

EnumerateFromFile(string, CsvOptions<char>?, Encoding?, CsvIOOptions)

Reads CSV records from the specified file using the specified encoding.

public static CsvRecordEnumerable<char> EnumerateFromFile(string path, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvRecordEnumerable<char>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

ReadFromFile<TValue>(string, CsvTypeMap<byte, TValue>, CsvOptions<byte>?, CsvIOOptions)

Parses CSV records from the specified file using the type map.

public static CsvTypeMapEnumerable<byte, TValue> ReadFromFile<TValue>(string path, CsvTypeMap<byte, TValue> typeMap, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

typeMap CsvTypeMap<byte, TValue>

Type map used to bind the CSV data

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvTypeMapEnumerable<byte, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

ReadFromFile<TValue>(string, CsvTypeMap<char, TValue>, CsvOptions<char>?, Encoding?, CsvIOOptions)

Parses CSV records from the specified file using the type map and the specified encoding.

public static CsvTypeMapEnumerable<char, TValue> ReadFromFile<TValue>(string path, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

ReadFromFile<TValue>(string, CsvOptions<byte>?, CsvIOOptions)

Parses CSV records from the specified file using reflection.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<byte, TValue> ReadFromFile<TValue>(string path, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvValueEnumerable<byte, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

ReadFromFile<TValue>(string, CsvOptions<char>?, Encoding?, CsvIOOptions)

Parses CSV records from the specified file using reflection and the specified encoding.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> ReadFromFile<TValue>(string path, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

path string

Path of the source file

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvValueEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(in ReadOnlySequence<byte>, CsvTypeMap<byte, TValue>, CsvOptions<byte>?)

Parses CSV records from the UTF8 CSV data.

public static CsvTypeMapEnumerable<byte, TValue> Read<TValue>(in ReadOnlySequence<byte> csv, CsvTypeMap<byte, TValue> typeMap, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlySequence<byte>

CSV data to read

typeMap CsvTypeMap<byte, TValue>

Type map used to bind the CSV data

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<byte, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(in ReadOnlySequence<byte>, CsvOptions<byte>?)

Parses CSV records from the UTF8 CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<byte, TValue> Read<TValue>(in ReadOnlySequence<byte> csv, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlySequence<byte>

CSV data to read

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvValueEnumerable<byte, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(in ReadOnlySequence<char>, CsvTypeMap<char, TValue>, CsvOptions<char>?)

Parses CSV records from the CSV data.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(in ReadOnlySequence<char> csv, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null)

Parameters

csv ReadOnlySequence<char>

CSV data to read

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(in ReadOnlySequence<char>, CsvOptions<char>?)

Parses CSV records from the CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(in ReadOnlySequence<char> csv, CsvOptions<char>? options = null)

Parameters

csv ReadOnlySequence<char>

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvValueEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(Stream, CsvTypeMap<byte, TValue>, CsvOptions<byte>?, CsvIOOptions)

Parses CSV records from the UTF8 CSV data using the type map.

public static CsvTypeMapEnumerable<byte, TValue> Read<TValue>(Stream stream, CsvTypeMap<byte, TValue> typeMap, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

typeMap CsvTypeMap<byte, TValue>

Type map used to bind the CSV data

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvTypeMapEnumerable<byte, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(Stream, CsvTypeMap<char, TValue>, CsvOptions<char>?, Encoding?, CsvIOOptions)

Parses CSV records from the CSV data using the type map and the specified encoding.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(Stream stream, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(Stream, CsvOptions<byte>?, CsvIOOptions)

Parses CSV records from the UTF8 CSV data using reflection.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<byte, TValue> Read<TValue>(Stream stream, CsvOptions<byte>? options = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

options CsvOptions<byte>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvValueEnumerable<byte, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(Stream, CsvOptions<char>?, Encoding?, CsvIOOptions)

Parses CSV records from the CSV data using reflection and the specified encoding.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(Stream stream, CsvOptions<char>? options = null, Encoding? encoding = null, CsvIOOptions ioOptions = default)

Parameters

stream Stream

Stream to read the CSV data from

options CsvOptions<char>

Options to use, Default used by default

encoding Encoding

Encoding to use. If null, UTF8, or ASCII, a specialized UTF8 reader is used instead of a StreamReader

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvValueEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(TextReader, CsvTypeMap<char, TValue>, CsvOptions<char>?, CsvIOOptions)

Parses CSV records from the CSV data using the type map.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(TextReader reader, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null, CsvIOOptions ioOptions = default)

Parameters

reader TextReader

TextReader to read the CSV data from

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(TextReader, CsvOptions<char>?, CsvIOOptions)

Parses CSV records from the CSV data using reflection.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(TextReader reader, CsvOptions<char>? options = null, CsvIOOptions ioOptions = default)

Parameters

reader TextReader

TextReader to read the CSV data from

options CsvOptions<char>

Options to use, Default used by default

ioOptions CsvIOOptions

Options to configure the buffer size and other IO related options

Returns

CsvValueEnumerable<char, TValue>

An enumerable that parses instances from the CSV data in a forward-only fashion. The enumerable can be used with foreach or await foreach, and with LINQ.

Type Parameters

TValue

Read<TValue>(ReadOnlyMemory<byte>, CsvTypeMap<byte, TValue>, CsvOptions<byte>?)

Parses CSV records from the UTF8 CSV data.

public static CsvTypeMapEnumerable<byte, TValue> Read<TValue>(ReadOnlyMemory<byte> csv, CsvTypeMap<byte, TValue> typeMap, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlyMemory<byte>

CSV data to read

typeMap CsvTypeMap<byte, TValue>

Type map used to bind the CSV data

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<byte, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(ReadOnlyMemory<byte>, CsvOptions<byte>?)

Parses CSV records from the UTF8 CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<byte, TValue> Read<TValue>(ReadOnlyMemory<byte> csv, CsvOptions<byte>? options = null)

Parameters

csv ReadOnlyMemory<byte>

CSV data to read

options CsvOptions<byte>

Options to use, Default used by default

Returns

CsvValueEnumerable<byte, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(ReadOnlyMemory<char>, CsvTypeMap<char, TValue>, CsvOptions<char>?)

Parses CSV records from the CSV data.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(ReadOnlyMemory<char> csv, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null)

Parameters

csv ReadOnlyMemory<char>

CSV data to read

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(ReadOnlyMemory<char>, CsvOptions<char>?)

Parses CSV records from the CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(ReadOnlyMemory<char> csv, CsvOptions<char>? options = null)

Parameters

csv ReadOnlyMemory<char>

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvValueEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(string?, CsvTypeMap<char, TValue>, CsvOptions<char>?)

Parses CSV records from the CSV data.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(string? csv, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null)

Parameters

csv string

CSV data to read

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(string?, CsvOptions<char>?)

Parses CSV records from the CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(string? csv, CsvOptions<char>? options = null)

Parameters

csv string

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvValueEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(StringBuilder?, CsvTypeMap<char, TValue>, CsvOptions<char>?)

Parses CSV records from the CSV data.

public static CsvTypeMapEnumerable<char, TValue> Read<TValue>(StringBuilder? csv, CsvTypeMap<char, TValue> typeMap, CsvOptions<char>? options = null)

Parameters

csv StringBuilder

CSV data to read

typeMap CsvTypeMap<char, TValue>

Type map used to bind the CSV data

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvTypeMapEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.

Read<TValue>(StringBuilder?, CsvOptions<char>?)

Parses CSV records from the CSV data.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public static CsvValueEnumerable<char, TValue> Read<TValue>(StringBuilder? csv, CsvOptions<char>? options = null)

Parameters

csv StringBuilder

CSV data to read

options CsvOptions<char>

Options to use, Default used by default

Returns

CsvValueEnumerable<char, TValue>

An enumerable that can be used with foreach or await foreach to read the CSV records.

Type Parameters

TValue

Remarks

CsvRecord<T> instances are only valid until MoveNext() is called again. The returned enumerator is intended to be used in a foreach loop. Improper use will throw a runtime exception.