Skip to content

Instantly share code, notes, and snippets.

@jovaneyck
Last active Jun 18, 2017
Embed
What would you like to do?
Read a CSV file with CsvProvider
#r @"..\packages\FSharp.Data\lib\net40\Fsharp.Data.dll"
open FSharp.Data
let [<Literal>] csvPath = ".\goodreads_library_export.csv"
type File = CsvProvider<csvPath>
let excel = new File()
excel.Rows
|> Seq.sortByDescending (fun book -> book.``Average Rating``)
|> Seq.take 10
|> Seq.map (fun book -> book.``Average Rating``, book.Title)
|> Seq.iter (printfn "%A")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment