I have a Dictionary<string, int> which contains components as string and positions as int. Now I want to divide the dictionary into four groups and save each group in a separate dictionary.
group 1 = all positions 1 - 32
group 2 = all positions 33 -64
group 3 = all positions 101 - 132
group 4 = all positions 133 - 164
This is what I have at the moment.
Dictionary<string, int> dictionary = compPos;
After filling the dictionary I ordered the dictionary like this.
var items = from pair in dictionary
orderby pair.Value ascending
select pair;
I was thinking about using for loops to get all the components and positions where value <= 32 etc. But so far this is the only way I think it might be possible.