CSV类型提供程序,Filtring序列

时间:2015-06-21 11:48:33

标签: f# type-providers

我正在尝试使用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 = "john.doe@foobar.com").Rows |> Seq.head

使用简单的csv文件:

last_name, first_name, date_of_birth, email, salaire, balance Doe,
John, 1982/10/08, john.doe@foobar.com, 2000, -1000 Ann, Mary,
1975/03/11, mary.ann@foobar.com, 5000, 10000 White, Bary, 1968/01/24,
white@bary.com, 10000, 150000

编写的代码应该是John Doe的客户,但我不知道为什么不能工作......我尝试了许多其他方法使其成功,任何想法?

0 个答案:

没有答案