I have an Excel file (csv separated with ";") with n columns, right now it doesn't matter the number of columns, just let's say that n is 6.
There are two out of these six columns, let's call them Column_A
and Column_B
that I want to convert into a dictionary (Dictionary<string, List<string>>
) where the key will be the column name and the values are a list formed by the values in the cell, which will be text.
As instance, if I had the following Excel file:
I would like to get a dictionary with two keys, Column_A
and Column_B
where its values are a list and each item on the list is its correspondent value:
desired_dictionary = {"column_A": ["a1", "a2", "a3. a31", "a4"], "column_B" = ["b1", "b2", "b3", "b4. b41"]}
Is there a way to do this?