I have a shapefile, which contains track points of a gpx file. Every track point has a number in its "number" field that tells the numeric name of the track the point belongs to. So points are clustered in a way. Unfortunately, there is no information about the order of the points (track segment) in a group. I have an unclear idea of using Python and a nested For-loop but my Python knowledge is super-limited. This VBA-ish method is the way I think it could work (I'm really sorry, I still have a lot to learn)
For n = 1 To 'max number of groups' fcount = 'number of features in a group' For m = 1 To fcount track_seg = m #field name where result goes Next m Next n
And this would be the preferred output in QGIS:
(Number one: start point; last number: end point).