I am trying to find an example of how to read a csv file using linq. My problem is that the examples I have found so far, the csv file is stored on the local machine and I am pulling the csv file from azure. Here is the example I found so far:
var stuff = from l in File.ReadLines(filename)
let x = l.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)
.Skip(1)
.Select(s => int.Parse(s))
select new
{
Sum = x.Sum(),
Average = x.Average()
};
The problem is in my pull from Azure, I have to use DownloadToStream and move the file to a MemoryStream. When I have to work with MemoryStream, what should replace "File.ReadLines(filename)"?