找回密码
 加入
搜索
楼主: Robell_liu

[效率算法] 求一算法:枚举文件内容特定值到不同的数组

 火.. [复制链接]
发表于 2010-9-9 21:58:40 | 显示全部楼层
附件是針對15樓的,不適用於最初的問題
游客,本帖隐藏的内容需要积分高于 1 才可浏览,您当前积分为 0

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +20 收起 理由
Robell_liu + 20

查看全部评分

 楼主| 发表于 2010-9-10 16:56:48 | 显示全部楼层
To: Duvet
用你的2种代码分析不同数据时发现在 列举第一组数据的时候 正则表达式把它分成了几个组
就如这组数据 ,正则表达式把它分成了几组
"73:72:4718665"
"70:71:4653126"
"71:72:4718663"
"72:71:4653128"
"72:71:4653128"

还有这组数据 ,正则表达式把它分成了几组

"3:2:4718665"
"0:1:4653126"
"1:2:4718663"
"2:1:4653128"
"2:1:4653128"


详细数据如下:
1:                            run   data.log.au3
左右同步递增 详细数据:

"73:72:4718665"
"70:71:4653126"
"71:72:4718663"
"72:71:4653128"
"72:71:4653128"
"1153:1135:74384513"
"1168:1149:75302032"
"1168:1150:75367568"
"1168:1151:75433104"
"1170:1150:75367570"
"3696:3634:238161520"
"3699:3634:238161523"
"3696:3633:238095984"
"3695:3633:238095983"
"3697:3632:238030449"
"7291:7168:469769339"
"7293:7158:469113981"
"7287:7162:469376119"
"7286:7165:469572726"
"7286:7166:469638262"
"12194:11979:785067938"
"12193:11980:785133473"
"12191:11977:784936863"
"12192:11977:784936864"
"12190:11977:784936862"
"18712:18389:1205160216"
"18710:18384:1204832534"
"18712:18388:1205094680"
"18719:18394:1205487903"
"18722:18396:1205618978"
"24284:23863:1563909852"
"24291:23870:1564368611"
"24299:23873:1564565227"
"24297:23872:1564499689"
"24300:23879:1564958444"
"29502:28194:1847751486"
"31470:30914:2026011374"
"31471:30916:2026142447"
"31471:30918:2026273519"
"31472:30925:2026732272"
"31517:30967:2029484829"
"32768:32768:2147516416"
"32768:32768:2147516416"
"32768:32768:2147516416"


2:            run   data1.log.au3
右边数递增数据:

"32768:70:4620288"
"32768:70:4620288"
"32768:70:4620288"
"32768:70:4620288"
"32768:72:4751360"
"32768:71:4685824"
"32768:71:4685824"
"32768:71:4685824"
"32768:73:4816896"
"32768:72:4751360"
"32768:889:58294272"
"32768:909:59604992"
"32768:911:59736064"
"32768:911:59736064"
"32768:910:59670528"
"32768:2822:184975360"
"32768:2822:184975360"
"32768:2820:184844288"
"32768:2823:185040896"
"32768:2819:184778752"
"32768:5542:363233280"
"32768:5542:363233280"
"32768:5544:363364352"
"32768:5543:363298816"
"32768:5541:363167744"
"32768:6913:453083136"
"32768:8496:556826624"
"32768:8498:556957696"
"32768:8494:556695552"
"32768:8493:556630016"
"32768:8796:576487424"
"32768:13053:855474176"
"32768:13052:855408640"
"32768:13053:855474176"
"32768:13053:855474176"
"32768:13049:855212032"
"32768:18384:1204846592"
"32768:18384:1204846592"
"32768:18392:1205370880"
"32768:18394:1205501952"
"32768:18393:1205436416"
"32768:23867:1564180480"
"32768:23870:1564377088"
"32768:23875:1564704768"
"32768:23880:1565032448"
"32768:23886:1565425664"
"32768:28362:1858764800"
"32768:28365:1858961408"
"32768:28370:1859289088"
"32768:28408:1861779456"
"32768:28410:1861910528"
"32768:32768:2147516416"
"32768:32768:2147516416"
"32768:32768:2147516416"
"32768:32768:2147516416"
发表于 2010-9-22 11:11:13 | 显示全部楼层
本帖最后由 liufenglg 于 2010-9-22 11:12 编辑

#Include <Array.au3>
#Include <File.au3>

$i1 = _FileCountLines("DATA.LOG")
Local $a

For $i = 1 To $i1

$file = "Tdata.txt";以Tdata.txt作为临时文件
$line = FileReadLine("DATA.LOG",$i)

$str = StringRegExp($line,'\"(.+?):.*',3);读出第一个冒号的数值,并以此作为数组划分的依据
$num = StringLen($str[0]);读出第一个冒号数值的长度
IniWrite($file,$num,$i,$line)
Next

;以上,将DATA.LOG中的内容整理成了一个INI结构的临时文件
;下面,将临时文件中的内容写入数组

$s = IniReadSectionNames ("Tdata.txt");读取ini文件,确定数组的数量

For $i = 1 To $s[0]

$a = IniReadSection("Tdata.txt",$s[$i])
_ArrayDisplay($a,"数组"&$i)

Next

    很强
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 02:30 , Processed in 0.116663 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表