I have a Dictionary(List, List(string)) (apologies, for some reason, this editor is not allowing me to type <>) which looks like the following:
Key: A --> Value:{1,2,3}
Key: B --> Value:{a,b,c}
Key: C --> Value:{Hi,Hello,Hola}
I would like to create a .csv file with Headers corresponding to my dictionary Keys, and 'Columns' corresponding to the List's.
So, for instance, First 'column in my csv file should be: column 'A', with values 1 2 3 Second 'column' in my csv file should be: column 'B', with values a b c, etc.. (Note that I would prefer that the ordering of the columns be kept, but it is ok if it's not)
Or in other words, since this will be a Comma Separated File, the First 'Row' (Headers) should be:
A,B,C
2nd row:
1, a , Hi
3rd row:
2, b, Hello
and 4th row:
3, c, Hola
What is the best way to achieve this in C#? I have tried researching this first, but most suggestions I seem to see online seem to not use a dictionary in the format Dictionary(List, List(string)).
I appreciate the help.