2

I'm experimenting with FsLab and CvsProvider. The script below works in the f# REPL, however, I do not get any intellisense of the column names of the ckv file e.g. "Date" and "Open" in example below. Therefore, the MSVS also marks those as undefined field, constructor, or member.

I install FsLab 1.1.6 with packet / nuget.

Any ideas how I can get it just like any tutorial video out there?

Regards, WP

#load "packages/FsLab/FsLab.fsx"

#load ".paket/load/net452/FSharp.Data.fsx"
open FSharp.Data

type Stocks = CsvProvider<"../../MSFT.csv">

//let msft = Stocks.Load("../../MSFT.csv")
let msft = CsvProvider<"../../MSFT.csv">.GetSample()    

// Look at the most recent row. Note the 'Date' property
// is of type 'DateTime' and 'Open' has a type 'decimal'
let firstRow = msft.Rows |> Seq.head
let lastDate = firstRow.Date
let lastOpen = firstRow.Open

// Print the prices in the HLOC format
for row in msft.Rows do
  printfn "HLOC: (%A, %A, %A, %A)" row.High row.Low row.Open row.Close
wpl
  • 86
  • 1
  • 8

0 Answers0