CSV Type Provider, Filtring the sequence

65 views Asked by At

I am trying to get started with Type Provider,

#r "../packages/FSharp.Data.2.2.3/lib/net40/FSharp.Data.dll"
open FSharp.Data

// Define your library scripting code here
let customers = new CsvProvider<"Data/customer.csv">()

let cust = customers.Filter(fun row -> row.Email = "[email protected]").Rows |> Seq.head

With a simple csv file :

last_name, first_name, date_of_birth, email, salaire, balance Doe,
John, 1982/10/08, [email protected], 2000, -1000 Ann, Mary,
1975/03/11, [email protected], 5000, 10000 White, Bary, 1968/01/24,
[email protected], 10000, 150000

The code written is supposed to get John Doe customer, but I don't know why that's don't work... I tried many other ways to make it works, any idea ?

0

There are 0 answers