#include <Array.au3>
Local $hFileOpen = FileOpen("C:\Users\wuhy\Desktop\1.txt",0)
Local $newFileOpen = FileOpen("C:\Users\wuhy\Desktop\2.txt",1)
Local $aArray = FileReadToArray($hFileOpen)
Local $index = _ArrayFindAll($aArray,"VolumePos:",0,0,0,1)
$num = 0
While $num <= UBound($index)
$linePos = FileReadLine($hFileOpen,$index[$num]+1)
$lineLetter = FileReadLine($hFileOpen,$index[$num] + 2)
$slinePos = StringTrimLeft(StringStripWS($linePos,8),10);删除 VolumePos 后获得后面的值
$slineLetter = StringTrimLeft(StringStripWS($lineLetter,8),10) ;删除 DriveLetter 后获得后面的值
FileWriteLine($newFileOpen,$slinePos & " " & $slineLetter & @CRLF)
$num = $num + 1
If StringInStr($slinePos,"80.") <> 0 Then Exit
WEnd
|