I am trying to turn an excel file containing multiple sheets into a dictionary of the following format
Sheets(“SheetName”) => Key(“KeyName”), Value or Key(“SectionName”), Value(“KeyName”)(range to another Key, Value table)
example one => MasterDictionary(“SheetName”)(“KeyName”)
example two => MasterDictionary(“SheetName”)(“SectionName”)(“KeyName”)
I initially figured MasterDictionary(of String, Dictionary(of string, Dictionary(of String, String)
this would solve example two, however I am then unable to resolve example one.
I then tried MasterDictionary(of String, Object); however this would only work so far…
e.g. example one => MasterDictionary(“SheetName”) would then produce a Dictionary(of String, String for the object portion and I couldn’t use MasterDictionary(“SheetName”)(“KeyName”)
I have been reading the forums, vbnet forums and c# forums trying to figure out how to achieve this.
ideally I would like it to be similar to getting info from a JSON Object
any advise or solutions would be greatly appreciated. Thank you
If i understand correct first one is having two levels and second 3… so should it be like MasterDictionary(of String, Dictionary(of String, String)) this?
I understand your situation now I beleive. So for this if you use object in the second level then i beleive because dict structure is not defined you are unable to add the 3rd dict. Why not convert your options to 3 layers for both
Maindic(of string,subdict(of string,dict(of string,string))) will be your final one
For first model use dict(sheet)(key1)(key1)
For second use dict(sheet)(sub1)(key1)
Just replicate your first key twice that creates a mock 3 layer of your two layers