Here is my first interactive attempt to work with the Netflix files. I have attempted this before in C# , but ran out of free time. Here is my F# code with comments on what I am attempting to do.
//We need to read files from disk
open System.IO
//Open the file and assign it to the file variable
let file = File.OpenText("c:\\SRC_Local\\SampleData\\download\\training_set\\training_set\\mv_0000001.txt")
//Read the whole file in a string
let contents = file.ReadToEnd()
//Here is where my functional side and imperative side start to battle a little
//first split the file by carriage return line feed
let data =
contents.Split(System.Environment.NewLine.ToCharArray())
//Next split each line by ;
let data2 =
data
|>Seq.map(fun i -> i.Split([|';'|]))
//Skip the first item
let data3 =
data
|> Seq.skip(1)
I am going to poke around some more and will post up part II when i get something interesting.