I have a file in the following format consisting of multiple entries in different lines. DirectorName MovieName GrossRevenue . eg
abc movie1 1mill
xyz movie2 2mill
abc movie3 1mill
abc movie2 4mill
the director name repeats itself and so does the moviename (director1 can direct a movie with the same name as director2)? what would be the best way to parse the file while providing the ability to get details like, total revenue for a director. I was planning on having a Dictionary of dictionaries something like
Dictionary<string, Dictionary<string,long>>
with the key for the outer dictionary being director name and the key for the inner dictionary being movie name. I could make this look better by wrapping my inner dictionary within a custom class but I was wondering if there is a better approach to this problem. Also how would i design this so that if later my file has additional content like genre, actors etc added , i would still not have to do a complete redesign while providing the ability to group by genre or actor