FSharp.Data


CsvFile Type

Represents a CSV file. The lines are read on demand from reader. Columns are delimited by one of the chars passed by separators (defaults to just ,), and to escape the separator chars, the quote character will be used (defaults to "). If hasHeaders is true (the default), the first line read by reader will not be considered part of data. If ignoreErrors is true (the default is false), rows with a different number of columns from the header row (or the first row if headers are not present) will be ignored. The first skipRows lines will be skipped.

Instance members

Instance member Description

this.GetColumnIndex(columnName)

Full Usage: this.GetColumnIndex(columnName)

Parameters:
    columnName : string

Returns: int

Returns the index of the column with the given name

columnName : string
Returns: int

this.TryGetColumnIndex(columnName)

Full Usage: this.TryGetColumnIndex(columnName)

Parameters:
    columnName : string

Returns: int option

Returns the index of the column with the given name, or returns None if no column is found

columnName : string
Returns: int option

Static members

Static member Description

CsvFile.AsyncLoad(uri, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows, ?encoding)

Full Usage: CsvFile.AsyncLoad(uri, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows, ?encoding)

Parameters:
    uri : string
    ?separators : string
    ?quote : char
    ?hasHeaders : bool
    ?ignoreErrors : bool
    ?skipRows : int
    ?encoding : Encoding

Returns: Async<CsvFile>

Loads CSV from the specified uri asynchronously

uri : string
?separators : string
?quote : char
?hasHeaders : bool
?ignoreErrors : bool
?skipRows : int
?encoding : Encoding
Returns: Async<CsvFile>

CsvFile.Load(uri, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows, ?encoding)

Full Usage: CsvFile.Load(uri, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows, ?encoding)

Parameters:
    uri : string
    ?separators : string
    ?quote : char
    ?hasHeaders : bool
    ?ignoreErrors : bool
    ?skipRows : int
    ?encoding : Encoding

Returns: CsvFile

Loads CSV from the specified uri

uri : string
?separators : string
?quote : char
?hasHeaders : bool
?ignoreErrors : bool
?skipRows : int
?encoding : Encoding
Returns: CsvFile

CsvFile.Load(reader, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Full Usage: CsvFile.Load(reader, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Parameters:
    reader : TextReader
    ?separators : string
    ?quote : char
    ?hasHeaders : bool
    ?ignoreErrors : bool
    ?skipRows : int

Returns: CsvFile

Loads CSV from the specified reader

reader : TextReader
?separators : string
?quote : char
?hasHeaders : bool
?ignoreErrors : bool
?skipRows : int
Returns: CsvFile

CsvFile.Load(stream, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Full Usage: CsvFile.Load(stream, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Parameters:
    stream : Stream
    ?separators : string
    ?quote : char
    ?hasHeaders : bool
    ?ignoreErrors : bool
    ?skipRows : int

Returns: CsvFile

Loads CSV from the specified stream

stream : Stream
?separators : string
?quote : char
?hasHeaders : bool
?ignoreErrors : bool
?skipRows : int
Returns: CsvFile

CsvFile.Parse(text, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Full Usage: CsvFile.Parse(text, ?separators, ?quote, ?hasHeaders, ?ignoreErrors, ?skipRows)

Parameters:
    text : string
    ?separators : string
    ?quote : char
    ?hasHeaders : bool
    ?ignoreErrors : bool
    ?skipRows : int

Returns: CsvFile

Parses the specified CSV content

text : string
?separators : string
?quote : char
?hasHeaders : bool
?ignoreErrors : bool
?skipRows : int
Returns: CsvFile