Skip to content

Instantly share code, notes, and snippets.

Last active Jun 18, 2017
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()
|> Seq.sortByDescending (fun book -> book.``Average Rating``)
|> Seq.take 10
|> (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