Example: Parsing a Tab Separated File
A real-world challenge, made more tractable by LINQ, is parsing a delimited file and extracting useful information as if it came from a normalized database. In this next example, we parse the contents of a tab-separated, value text file. The following are the first few lines of the file and its tab-separated fields:
name id beer_style first_brewed alcohol_content original_gravity
final_gravity ibu_scale country brewery_brand color_srm from_region containers
Miller Genuine Draft /m/02hv39w
Hakim Stout /m/059q7h1 Stout 5.8 Harar Beer Factory Ethiopia ...
Get Programming Reactive Extensions and LINQ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.