I am sure that you are not requesting the full pivot table function in Excel. I think you need a simple statistics table based on discrete explanatory variables and statistics data. If you do this, I think it is so that writing from scratch can be faster than looking at other implementations.
Just update the std :: map (or similar data structure) of a key that represents a combination of explanatory variables and statistics data values when reading each data point.
After reading, you just need to organize an output table with a map, which may be trivial depending on your goal.
I believe that most of the C # examples in this question that you have linked all the same use this approach.
source
share