稍微改一下表达式
;#include <GuiListView.au3>
GUICreate("测试", 560, 200)
$ListView1 = GUICtrlCreateListView('No.|Dr|Tag|FileSystem|Volume|Act|StartPos|Sectors|MBytes|FreeMB', 5, 5, 550, 150)
GUISetState()
_ld()
While 1
If GUIGetMsg() = -3 Then Exit
WEnd
Func _ld()
_GUICtrlListView_DeleteAllItems($ListView1)
Local $str = FileRead('text.txt'), $i, $dt
Local $array = StringRegExp($str, '(\d\:\d+)\h+([C-Z]\:)?\h+(.+?)\h+(.+?)\h+(.+?)\h+(Yes|\h+?)\h+(\d+)\h+(\d+)\h+(\d+)\h+(\d*)', 3)
If @error Then Return MsgBox(48, 0, '错误')
For $i = 0 To UBound($array) - 10 Step 10
$dt = $array[$i] & '|' & $array[$i + 1] & '|' & $array[$i + 2] & '|' & $array[$i + 3] & '|' & $array[$i + 4] & '|' & $array[$i + 5] & '|' & $array[$i + 6] & '|' & $array[$i + 7] & '|' & $array[$i + 8] & '|' & $array[$i + 9]
GUICtrlCreateListViewItem($dt, $ListView1)
Next
EndFunc ;==>_ld
|