F# Data


Namespace: FSharp.Data

Typed representation of a CSV file.

Static parameters

Static parametersDescription
Signature: string (optional, default = "")

Location of a CSV sample file or a string containing a sample CSV document.

Signature: string (optional, default = "")

Column delimiter(s). Defaults to ,.

Signature: int (optional, default = 1000)

Number of rows to use for inference. Defaults to 1000. If this is zero, all rows are used.

Signature: string (optional, default = "")

Optional column types, in a comma separated list. Valid types are int, int64, bool, float, decimal, date, guid, string, int?, int64?, bool?, float?, decimal?, date?, guid?, int option, int64 option, bool option, float option, decimal option, date option, guid option and string option. You can also specify a unit and the name of the column like this: Name (type<unit>), or you can override only the name. If you don't want to specify all the columns, you can reference the columns by name like this: ColumnName=type.

Signature: bool (optional, default = true)

Whether the sample contains the names of the columns as its first line.

Signature: bool (optional, default = false)

Whether to ignore rows that have the wrong number of columns or which can't be parsed using the inferred or specified schema. Otherwise an exception is thrown when these rows are encountered.

Signature: int (optional, default = 0)

Skips the first n rows of the CSV file.

Signature: bool (optional, default = false)

When set to true, the type provider will assume all columns can have missing values, even if in the provided sample all values are present. Defaults to false.

Signature: bool (optional, default = false)

When set to true, inference will prefer to use the option type instead of nullable types, double.NaN or "" for missing values. Defaults to false.

Signature: char (optional, default = '"')

The quotation mark (for surrounding values containing the delimiter). Defaults to ".

Signature: string (optional, default = "")

The set of strings recogized as missing values. Defaults to NaN,NA,N/A,#N/A,:,-,TBA,TBD.

Signature: bool (optional, default = true)

Whether the rows should be caches so they can be iterated multiple times. Defaults to true. Disable for large datasets.

Signature: string (optional, default = "")

The culture used for parsing numbers and dates. Defaults to the invariant culture.

Signature: string (optional, default = "")

The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless charset is specified in the Content-Type response header.

Signature: string (optional, default = "")

A directory that is used when resolving relative file references (at design time and in hosted execution).

Signature: string (optional, default = "")

When specified, the type provider first attempts to load the sample from the specified resource (e.g. 'MyCompany.MyAssembly, resource_name.csv'). This is useful when exposing types generated by the type provider.

Fork me on GitHub