StringBuilder sb = new StringBuilder();
foreach (KeyValuePair<mainKey, SubDict> pair1 in mainDict)
foreach (KeyValuePair<subKey, sub1Dict> pair2 in pair1.Value)
foreach (KeyValuePair<sub1Key, sub2Dict> pair3 in pair2.Value)
foreach (KeyValuePair<sub2Key, sub2Value> pair4 in pair3.Value)
{
sb.AppendFormat("{0}/{1}/{2}/{3}, {4}",
pair1.Key, pair2.Key, pair3.Key, pair4.Key, pair4.Value);
}
UPDATE:
StringBuilder sb = new StringBuilder();
foreach (KeyValuePair<string, object> pair1 in mainDict)
foreach (KeyValuePair<string, object> pair2 in (Dictionary<string, object>)pair1.Value)
foreach (KeyValuePair<string, object> pair3 in (Dictionary<string, object>)pair2.Value)
foreach (KeyValuePair<string, object> pair4 in (Dictionary<string, object>)pair3.Value)
{
sb.AppendFormat("{0}/{1}/{2}/{3}, {4}",
pair1.Key, pair2.Key, pair3.Key, pair4.Key, pair4.Value);
}