Thinkai's Blog

Autohotkey|Python|php|aardio|VOIP|IT 爱好者

ahk取重复前十的一种方法 Autohotkey 4276

作者为 发表

Autohotkey

;duplicate top10
src =
(
加
就
加
加
加
的
到
否
的
额
一
他
个
飞
的
的
他
的
对
额
额
他
哦
平
去
我
额
人
啊
是
的
飞
个
好
)

a := []
b =
loop, Parse, src, `n, `r
{
	if !a["" A_LoopField]
		a["" A_LoopField] := 1
	else
		a["" A_LoopField] += 1
}

for c,d in a
{
	d2 := SubStr("00000", 1, 5-strlen(d)) d
	str := d2 "_" c
	b .= b ? "`n" str : str
}

Sort, b, R

e := StrSplit(b,"`n","`r")
f =
loop 10
	f .= f ? "`n" e[A_index] : e[A_index]

MsgBox % f



来了就留个评论吧! 4个评论




友情链接:Autohotkey中文帮助Autohotkey官网Autohotkey中文网联系作者免GooglePlay APK下载

 主题设计 • skyfrit.com  Thinkai's Blog | 保留所有权利

60 queries in 2.087 seconds |