FSharp.Data


CsvFile<'RowType> Type

Constructors

Constructor Description

CsvFile(stringArrayToRow, rowToStringArray, readerFunc, separators, quote, hasHeaders, ignoreErrors, skipRows)

Full Usage: CsvFile(stringArrayToRow, rowToStringArray, readerFunc, separators, quote, hasHeaders, ignoreErrors, skipRows)

Parameters:
    stringArrayToRow : Func<obj, string[], 'RowType>
    rowToStringArray : Func<'RowType, string[]>
    readerFunc : Func<TextReader>
    separators : string
    quote : char
    hasHeaders : bool
    ignoreErrors : bool
    skipRows : int

Returns: CsvFile<'RowType>
stringArrayToRow : Func<obj, string[], 'RowType>
rowToStringArray : Func<'RowType, string[]>
readerFunc : Func<TextReader>
separators : string
quote : char
hasHeaders : bool
ignoreErrors : bool
skipRows : int
Returns: CsvFile<'RowType>

Instance members

Instance member Description

this.Append(rows)

Full Usage: this.Append(rows)

Parameters:
    rows : seq<'RowType>

Returns: CsvFile<'RowType>

Returns a csv with the same rows as the original plus the provided rows appended

rows : seq<'RowType>
Returns: CsvFile<'RowType>

this.Cache()

Full Usage: this.Cache()

Returns: CsvFile<'RowType>

Returns a new csv with the same rows as the original but which guarantees that each row will be only be read and parsed from the input at most once.

Returns: CsvFile<'RowType>

this.Filter(predicate)

Full Usage: this.Filter(predicate)

Parameters:
    predicate : Func<'RowType, bool>

Returns: CsvFile<'RowType>

Returns a new csv containing only the rows for which the given predicate returns "true".

predicate : Func<'RowType, bool>
Returns: CsvFile<'RowType>

this.Headers

Full Usage: this.Headers

Returns: string[] option

The names of the columns

Returns: string[] option

this.Map(mapping)

Full Usage: this.Map(mapping)

Parameters:
    mapping : Func<'RowType, 'RowType>

Returns: CsvFile<'RowType>

Returns a new csv where every row has been transformed by the provided mapping function.

mapping : Func<'RowType, 'RowType>
Returns: CsvFile<'RowType>

this.NumberOfColumns

Full Usage: this.NumberOfColumns

Returns: int

The number of columns

Returns: int

this.Quote

Full Usage: this.Quote

Returns: char

The quotation mark use for surrounding values containing separator chars

Returns: char

this.Rows

Full Usage: this.Rows

Returns: seq<'RowType>

The rows with data

Returns: seq<'RowType>

this.Save(path, ?separator, ?quote)

Full Usage: this.Save(path, ?separator, ?quote)

Parameters:
    path : string
    ?separator : char
    ?quote : char

Saves CSV to the specified file

path : string
?separator : char
?quote : char

this.Save(stream, ?separator, ?quote)

Full Usage: this.Save(stream, ?separator, ?quote)

Parameters:
    stream : Stream
    ?separator : char
    ?quote : char

Saves CSV to the specified stream

stream : Stream
?separator : char
?quote : char

this.Save(writer, ?separator, ?quote)

Full Usage: this.Save(writer, ?separator, ?quote)

Parameters:
    writer : TextWriter
    ?separator : char
    ?quote : char

Saves CSV to the specified writer

writer : TextWriter
?separator : char
?quote : char

this.SaveToString(?separator, ?quote)

Full Usage: this.SaveToString(?separator, ?quote)

Parameters:
    ?separator : char
    ?quote : char

Returns: string

Saves CSV to a string

?separator : char
?quote : char
Returns: string

this.Separators

Full Usage: this.Separators

Returns: string

The character(s) used as column separator(s)

Returns: string

this.Skip(count)

Full Usage: this.Skip(count)

Parameters:
    count : int

Returns: CsvFile<'RowType>

Returns a csv that skips N rows and then yields the remaining rows.

count : int
Returns: CsvFile<'RowType>

this.SkipWhile(predicate)

Full Usage: this.SkipWhile(predicate)

Parameters:
    predicate : Func<'RowType, bool>

Returns: CsvFile<'RowType>

Returns a csv that, when iterated, skips rows while the given predicate returns true, and then yields the remaining rows.

predicate : Func<'RowType, bool>
Returns: CsvFile<'RowType>

this.Take(count)

Full Usage: this.Take(count)

Parameters:
    count : int

Returns: CsvFile<'RowType>

Returns a new csv with only the first N rows of the underlying csv.

count : int
Returns: CsvFile<'RowType>

this.TakeWhile(predicate)

Full Usage: this.TakeWhile(predicate)

Parameters:
    predicate : Func<'RowType, bool>

Returns: CsvFile<'RowType>

Returns a csv that, when iterated, yields rowswhile the given predicate returns true, and then returns no further rows.

predicate : Func<'RowType, bool>
Returns: CsvFile<'RowType>

this.Truncate(count)

Full Usage: this.Truncate(count)

Parameters:
    count : int

Returns: CsvFile<'RowType>

Returns a csv that when enumerated returns at most N rows.

count : int
Returns: CsvFile<'RowType>

Static members

Static member Description

CsvFile.Create(stringArrayToRow, rowToStringArray, reader, separators, quote, hasHeaders, ignoreErrors, skipRows, cacheRows)

Full Usage: CsvFile.Create(stringArrayToRow, rowToStringArray, reader, separators, quote, hasHeaders, ignoreErrors, skipRows, cacheRows)

Parameters:
    stringArrayToRow : Func<obj, string[], 'RowType>
    rowToStringArray : Func<'RowType, string[]>
    reader : TextReader
    separators : string
    quote : char
    hasHeaders : bool
    ignoreErrors : bool
    skipRows : int
    cacheRows : bool

Returns: CsvFile<'RowType>
stringArrayToRow : Func<obj, string[], 'RowType>
rowToStringArray : Func<'RowType, string[]>
reader : TextReader
separators : string
quote : char
hasHeaders : bool
ignoreErrors : bool
skipRows : int
cacheRows : bool
Returns: CsvFile<'RowType>

CsvFile.CreateEmpty(rowToStringArray, rows, headers, numberOfColumns, separators, quote)

Full Usage: CsvFile.CreateEmpty(rowToStringArray, rows, headers, numberOfColumns, separators, quote)

Parameters:
    rowToStringArray : Func<'RowType, string[]>
    rows : seq<'RowType>
    headers : string[] option
    numberOfColumns : int
    separators : string
    quote : char

Returns: CsvFile<'RowType>
rowToStringArray : Func<'RowType, string[]>
rows : seq<'RowType>
headers : string[] option
numberOfColumns : int
separators : string
quote : char
Returns: CsvFile<'RowType>

CsvFile.ParseRows(text, stringArrayToRow, separators, quote, ignoreErrors)

Full Usage: CsvFile.ParseRows(text, stringArrayToRow, separators, quote, ignoreErrors)

Parameters:
    text : string
    stringArrayToRow : Func<obj, string[], 'RowType>
    separators : string
    quote : char
    ignoreErrors : bool

Returns: 'RowType[]
text : string
stringArrayToRow : Func<obj, string[], 'RowType>
separators : string
quote : char
ignoreErrors : bool
Returns: 'RowType[]