如何提取 这个txt的文本信息
Drive No. ActiveVolumeLabe Total (Mb) Free (Mb)C: 1:1 A 45841 39919
D: 1:2 30474 22399
下面 可能还会有新的盘符
我要的是 C:=1:1 D:=1:2
如果有新的 如 E:=1;3 等 信息 现在用的是这个方法 请问 还能否简单一点????
#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("partinfo.txt",$aRecords) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
For $x = 2 to $aRecords
if $aRecords[$x]="Drive No. ActiveVolumeLabe Total (Mb) Free (Mb)" Then
Else
$test=StringSplit($aRecords[$x]," ")
MsgBox(0,0,$test&" "&$test)
EndIf
Next
$a=FileRead("d:\a.txt")
;MsgBox(0,0,$a)
$b=StringRegExp($a,':\s+\d:\d',3)
For $i=0 to UBound($b)
;MsgBox(0,'test',$b[$i])
MsgBox(0,'test',StringRegExpReplace($b[$i],'\s+','='))
Next
简洁明了~~~~~~~
页:
[1]