用户提供的数据(以下数据为模拟数据):- "卡号:567757550053户名:湖北省红十字会金额:2.55元|卡号:567757550053户名:湖北省红十字会金额:2.55元|卡号:6226190300651977户名:支燕金额:7250.00元|卡号:6226190300651977户名:支燕金额:5.00元|卡号:6222620810024852952户名:张文婷金额:20000.00元|卡号:6222620810024852952户名:张文婷金额:7.50元|卡号:6212264000057258150户名:黄水木金额:27360.00元|卡号:6212264000057258150户名:黄水木金额:7.50元|卡号:6225380092789751户名:林倩虹金额:32758.00元|卡号:6225380092789751户名:林倩虹金额:7.50元|卡号:6222601310007998792户名:庄奕如金额:67314.00元|卡号:6222601310007998792户名:庄奕如金额:10.10元|卡号:6228481416709536871户名:黄泽龙金额:18950.00元|卡号:6228481416709536871户名:黄泽龙金额:7.50元|卡号:6217993900070506799户名:苏梅钦金额:29351.00元|卡号:6217993900070506799户名:苏梅钦金额:50000.00元|卡号:6214922605138696户名:欧阳明珠金额:11950.00元|卡号:6214922605138696户名:欧阳明珠金额:7.50元|卡号:6227001685040190332户名:刘会香金额:84600.00元|卡号:6227001685040190332户名:刘会香金额:12.69元|卡号:6236682480003805937户名:张秀丽金额:77350.00元|卡号:6236682480003805937户名:张秀丽金额:11.60元|卡号:6217007180001147336户名:杨小平金额:61880.00元|卡号:6217007180001147336户名:杨小平金额:9.28元|卡号:6222083602013719494户名:黄志武金额:22378.00元|卡号:6222083602013719494户名:黄志武金额:7.50元|卡号:622439360000038117户名:陈艳金额:16200.00元|卡号:622439360000038117户名:陈艳金额:7.50元|卡号:9559980380061102113户名:杨章华金额:30600.00元|卡号:9559980380061102113户名:杨章华金额:7.50元|卡号:6228450578064249072户名:姜丽金额:15490.00元|卡号:6228450578064249072户名:姜丽金额:7.50元|卡号:6217858000128642870户名:张秀丽金额:57239.00元|卡号:6217858000128642870户名:张秀丽金额:8.59元|卡号:6228480389567856577户名:王美凤金额:49950.00元|卡号:6228480389567856577户名:王美凤金额:7.50元|卡号:6217582000038672户名:卢金连金额:6800.00元|卡号:6217582000038672户名:卢金连金额:5.00元|卡号:6210810730010741974户名:陈小巧金额:13941.00元|卡号:6210810730010741974户名:陈小巧金额:7.50元|卡号:6228450388041116471户名:张宏辉金额:74400.00元|卡号:6228450388041116471户名:张宏辉金额:11.16元|卡号:6228480218774788572户名:杨萌林金额:10450.00元|卡号:6228480218774788572户名:杨萌林金额:7.50元|卡号:6212260200197454743户名:秦涛金额:12052.00元|卡号:6212260200197454743户名:秦涛金额:7.50元|卡号:6215581208002487217户名:陈苏瑾金额:50000.00元|卡号:6215581208002487217户名:陈苏瑾金额:7.50元|卡号:6228480078044677678户名:黄赋山金额:24000.00元|卡号:6228480078044677678户名:黄赋山金额:7.50元|卡号:6217751124002388588户名:田永兰金额:50000.00元|卡号:6217751124002388588户名:田永兰金额:7.50元|卡号:3002019401202051623户名:李勇勇金额:64.00元|卡号:6216698100008964588户名:张毅金额:5.00元|卡号:6216698100008964588户名:张毅金额:5.00元|卡号:6216698100008964588户名:张毅金额:5.00元|"
复制代码 用户需求:代码效果一览:源码一览(涉及知识 读写ini、排序、Split):dm="卡号:567757550053户名:湖北省红十字会金额:2.55元|卡号:567757550053户名:湖北省红十字会金额:2.55元|卡号:6226190300651977户名:支燕金额:7250.00元|卡号:6226190300651977户名:支燕金额:5.00元|卡号:6222620810024852952户名:张文婷金额:20000.00元|卡号:6222620810024852952户名:张文婷金额:7.50元|卡号:6212264000057258150户名:黄水木金额:27360.00元|卡号:6212264000057258150户名:黄水木金额:7.50元|卡号:6225380092789751户名:林倩虹金额:32758.00元|卡号:6225380092789751户名:林倩虹金额:7.50元|卡号:6222601310007998792户名:庄奕如金额:67314.00元|卡号:6222601310007998792户名:庄奕如金额:10.10元|卡号:6228481416709536871户名:黄泽龙金额:18950.00元|卡号:6228481416709536871户名:黄泽龙金额:7.50元|卡号:6217993900070506799户名:苏梅钦金额:29351.00元|卡号:6217993900070506799户名:苏梅钦金额:50000.00元|卡号:6214922605138696户名:欧阳明珠金额:11950.00元|卡号:6214922605138696户名:欧阳明珠金额:7.50元|卡号:6227001685040190332户名:刘会香金额:84600.00元|卡号:6227001685040190332户名:刘会香金额:12.69元|卡号:6236682480003805937户名:张秀丽金额:77350.00元|卡号:6236682480003805937户名:张秀丽金额:11.60元|卡号:6217007180001147336户名:杨小平金额:61880.00元|卡号:6217007180001147336户名:杨小平金额:9.28元|卡号:6222083602013719494户名:黄志武金额:22378.00元|卡号:6222083602013719494户名:黄志武金额:7.50元|卡号:622439360000038117户名:陈艳金额:16200.00元|卡号:622439360000038117户名:陈艳金额:7.50元|卡号:9559980380061102113户名:杨章华金额:30600.00元|卡号:9559980380061102113户名:杨章华金额:7.50元|卡号:6228450578064249072户名:姜丽金额:15490.00元|卡号:6228450578064249072户名:姜丽金额:7.50元|卡号:6217858000128642870户名:张秀丽金额:57239.00元|卡号:6217858000128642870户名:张秀丽金额:8.59元|卡号:6228480389567856577户名:王美凤金额:49950.00元|卡号:6228480389567856577户名:王美凤金额:7.50元|卡号:6217582000038672户名:卢金连金额:6800.00元|卡号:6217582000038672户名:卢金连金额:5.00元|卡号:6210810730010741974户名:陈小巧金额:13941.00元|卡号:6210810730010741974户名:陈小巧金额:7.50元|卡号:6228450388041116471户名:张宏辉金额:74400.00元|卡号:6228450388041116471户名:张宏辉金额:11.16元|卡号:6228480218774788572户名:杨萌林金额:10450.00元|卡号:6228480218774788572户名:杨萌林金额:7.50元|卡号:6212260200197454743户名:秦涛金额:12052.00元|卡号:6212260200197454743户名:秦涛金额:7.50元|卡号:6215581208002487217户名:陈苏瑾金额:50000.00元|卡号:6215581208002487217户名:陈苏瑾金额:7.50元|卡号:6228480078044677678户名:黄赋山金额:24000.00元|卡号:6228480078044677678户名:黄赋山金额:7.50元|卡号:6217751124002388588户名:田永兰金额:50000.00元|卡号:6217751124002388588户名:田永兰金额:7.50元|卡号:3002019401202051623户名:李勇勇金额:64.00元|卡号:6216698100008964588户名:张毅金额:5.00元|卡号:6216698100008964588户名:张毅金额:5.00元|卡号:6216698100008964588户名:张毅金额:5.00元|"
贷名字 = Split(dm, "|")
Call Plugin.File.DeleteFile("C:\计算.ini")
For ii = 0 To UBound(贷名字) - 1
//TracePrint 贷名字(ii)
卡号 = GetStrAB(贷名字(ii),"卡号:","户名")
户名 = GetStrAB(贷名字(ii),"户名:","金额")
金额 = GetStrAB(贷名字(ii),"金额:","元")
// TracePrint 卡号
// TracePrint 户名
// TracePrint 金额
数值 = Plugin.File.ReadINI("计算", "卡号:"&卡号&"户名:"& 户名, "C:\计算.ini")
//TracePrint 数值
If 数值 = "" Then
数值 = 0
Call Plugin.File.WriteINI("计算", "卡号:"&卡号&"户名:"& 户名&"-次数", 1, "C:\计算.ini")
Else
数值 = 数值 / 1
Call Plugin.File.WriteINI("计算", "卡号:"&卡号&"户名:"& 户名&"-次数", (Plugin.File.ReadINI("计算", "卡号:"&卡号&"户名:"& 户名&"-次数", "C:\计算.ini")\1)+1, "C:\计算.ini")
End If
Call Plugin.File.WriteINI("计算", "卡号:"&卡号&"户名:"& 户名, (数值+金额), "C:\计算.ini")
Next
总信息=""
Text = Plugin.File.ReadFileEx("C:\计算.ini")
MyArray = Split(Text, "|")
For i=1 to UBound(MyArray)-1 step 2
次数= split(MyArray(i),"=") (1)
信息 =split(MyArray(i + 1),"=") (0)&"-"&次数&"="&split(MyArray(i + 1),"=") (1)
// TracePrint 信息
总信息=总信息&信息&"|"
Next
总信息=mid(总信息,1,len(总信息)-1)
//TracePrint 总信息
a = split(总信息, "|")
//For i = 0 To UBound(a)-1
// TracePrint a(i)
//Next
for i=0 to ubound(a)-1
For n = 0 To ubound(a) - 1 - i
// TracePrint a(n)
值1 = (split(a(n), "=")(1))/ 1
值2 = (split(a(n+1), "=")(1))/ 1
if 值1>值2 then'>号
s=a(n)
a(n)=a(n+1)
a(n+1)=s
end if
next
Next
排序后= Replace( Replace(join(a, "|"),"=","金额:") ,"-","次数:")
分割 = split(排序后, "|")
For i = 0 To UBound(分割)
次数之前数据=split(分割(i), "次数:")(0)
次数 = GetStrAB(分割(i), "次数:", "金额")
金额=split(分割(i), "金额:")(1)
TracePrint 次数之前数据&"金额:"&金额&"元 转账次数:"&次数
Next
Function GetStrAB(Str, StrA, StrB)
If InStr(Str,StrA)>0 And InStr(Str,StrB)>0 Then GetStrAB=Split(Split(Str,StrA)(1),StrB)(0)
End Function