使用 CSV 类型提供程序
给出以下 CSV 文件:
Id,Name
1,"Joel"
2,"Adam"
3,"Ryan"
4,"Matt"
你可以使用以下脚本读取数据:
#r "FSharp.Data.dll"
open FSharp.Data
type PeopleDB = CsvProvider<"people.csv">
let people = PeopleDB.Load("people.csv") // this can be a URL
let joel = people.Rows |> Seq.head
printfn "Name: %s, Id: %i" joel.Name joel.Id