Error!
Success!

LINQ to CSV using DynamicObject

0
kicks

LINQ to CSV using DynamicObject  (Unpublished)

When we wrote LINQ in Action we included a sample of how to simply query against a CSV file using the following LINQ query: 1.From line In File.ReadAllLines(“books.csv”) 2.Where Not Line.StartsWith(“#”) 3.Let parts = line.Split(“,”c) 4.Select Isbn = parts(0), Title = parts(1), Publisher = parts(3)While this code does make dealing with CSV easier, it would be nicer if we could refer to our columns as if they were properties where the property name came from the header row in the CSV file, perhaps using syntax like the following:


Kicked By:
Drop Kicked By: