{"id":87,"date":"2009-01-31T15:30:00","date_gmt":"2009-01-31T15:30:00","guid":{"rendered":"https:\/\/wdev-blog.azurewebsites.net\/index.php\/2009\/01\/31\/read-csv-file-into-linq\/"},"modified":"2009-01-31T15:30:00","modified_gmt":"2009-01-31T15:30:00","slug":"read-csv-file-into-linq","status":"publish","type":"post","link":"http:\/\/www.panahy.nl\/index.php\/2009\/01\/31\/read-csv-file-into-linq\/","title":{"rendered":"Read CSV file into LINQ"},"content":{"rendered":"<p>This article is based on the great book of LINQ in Action. I am learning so much from it and I would like to keep a note of some handy subject from the book while not disturbing any copyright of ther authors. For the full story please buy the book from http:\/\/www.manning.com\/LINQinAction. <\/p>\n<pre> <br \/>using (StreamReader reader = new StreamReader(\"books.csv\"))<br \/>{<br \/>  var books = <br \/>    from line in reader.Lines()<br \/>    where !line.StartsWith(\"#\")<br \/>    let parts = line.Split(',')<br \/>    select new {<br \/>        Title = parts[1],<br \/>        Publisher = parts[3],<br \/>        Isbn = parts[0]<br \/>    };<br \/><br \/>  \/\/ use the books here ...<br \/>}<br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article is based on the great book of LINQ in Action. I am learning so much from it and I would like to keep a note of some handy subject from the book while not disturbing any copyright of ther authors. For the full story please buy the book from http:\/\/www.manning.com\/LINQinAction. using (StreamReader reader &hellip; <a href=\"http:\/\/www.panahy.nl\/index.php\/2009\/01\/31\/read-csv-file-into-linq\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Read CSV file into LINQ&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[33],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"Pouya Panahy","author_link":"http:\/\/www.panahy.nl\/index.php\/author\/pouya\/"},"uagb_comment_info":2,"uagb_excerpt":"This article is based on the great book of LINQ in Action. I am learning so much from it and I would like to keep a note of some handy subject from the book while not disturbing any copyright of ther authors. For the full story please buy the book from http:\/\/www.manning.com\/LINQinAction. using (StreamReader reader&hellip;","_links":{"self":[{"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/87"}],"collection":[{"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":0,"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.panahy.nl\/index.php\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}