I would like to get a list that shows how many times a item is in list from the most to least
2 2122
2 6525
1 3285
1 5485
I found code by sinkfaze that does everything except sorting by the number of occurrences
Code: Select all
text =
(
1
1
5
1
3
9
10
11
3
4
3
26
26
6
2
12
2
7
2
6
10
)
pos=1
While pos := RegExMatch(text,"\b\d+\b",m,pos+StrLen(m))
n .= (!n ? "" : "`n") m
Sort, n, U N
Loop, parse, n, `n, `r
RegExReplace(text,"\b" A_LoopField "\b","$0",count), out .= A_LoopField " - " count "`n"
MsgBox % out
ExitApp