I've got a csv with 35K rows with, among other, the following collumns: articleID, description, class1, class2, class 3.
the class collumns represent the categories to which the products belong. class1 is the main category, class2 is a subcategory of class1 and class3 is a subcategory of class2.
Now i want to extract the categories in a tree structure, but i'm kind of lost.
The only thing I could come up with is the following linq query to get a distinct list. (I am not an expert in either linq nor c#/.Net in general...
The ParseStream function returns a list of rows, with an array of collumn values. i[3], [4] and[5] represent class 1, 2 and 3
List<string[]> infoList = ParseStream(infoFile);
List<string> categories = (from i in infoList
select new StringBuilder().Append(i[3]).Append(";").Append(i[4]).Append(";").Append(i[5]).ToString())
.Distinct().ToList();
This just gives me a separated list of all category paths...
What i the best datatype to store a hiarchical list in? and how do I select this with linq?