RecentIy I needed to find a specific TreeNode in a TreeView control. I expected that would be easy with LINQ, but quickly realized that there is no method in the .NET framework that will let me traverse all nodes of a hierarchy. I decided to create one myself.
In this previous article articles about parsing files, I took a very simplistic approach to reading a delimited file. I used string.Split, which doesn’t handle the use of quotes and usage of the delimiter character inside quotes.
Well, it turns out theres more to reading a delimited file than splitting at the delimiter…
Microsoft Norway offers a free one-day course in ASP.NET.
In a previous article, I described how to use LINQ when parsing a textfile.
Following that train of thoughts further, I found a more elegant way of splitting the lines from the file into columns. Creating extension methods on top of IEnumerable<string> seems like a good idea! Something that could be used like this for a [...]
Reading and parsing files is really no difficult task with the .NET framework. The System.IO namespace has several good classes to aid that task.
Comments