给定以下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") // 这可以是一个URL let joel =people.Rows|> Seq.head printfn "Name: %s, Id: %i"joel.Namejoel.Id