For this dataset:
A B 1 a 1 b 2 f 2 h 2 m 1 b
I want to group the data set in order. I mean I want to group the firs