-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Description
Description
I have csv file with 16 columns. Because header (first row) is missing I am using Schema static paramater for naming columns. Since the number of columns is large enough, to improve readability of the code I am using line breaks when setting the parameter Schema. As result the CSV type provider shows the error "The input sequence contains more than one element"
Repro steps
Script which was used.
#r @"C:\Users\vadim\Documents\Develop\FSharp\zImport\packages\FSharp.Data\lib\net40\FSharp.Data.dll"
open FSharp.Data
type OrdersCSV =
CsvProvider< @"export_commerce_backoffice_orders.csv"
, Separators = "$"
, HasHeaders = false
, Schema = "OrderNumber (string),
OrderCreated (string),
OrderTotal (string),
FioShort (string),
PhoneNumber (string),
Email (string),
Comment (string),
FioFull (string),
Region (string),
Town (string),
Address (string),
Postindex (string),
ProductId (string),
ProductTitle (string),
ProductQuantity (string),
ProductPrice (string)"
>
let csv = OrdersCSV.GetSample()
Expected behavior
No errors :)
Actual behavior
CSV type provider shows the error "The input sequence contains more than one element".
Known workarounds
If I rewrite Schema string in a very long line, the error will be gone.
My suggestion: remove all the special characters in the user defined string "Schema".
Reactions are currently unavailable