#include <File.au3>
Dim $aFile[1], $sLine, $sName, $sIP, $sMAC
_FileReadToArray("1.txt", $aFile)
For $i = 5 To $aFile[0];数据从第五行开始的
$sLine = $aFile[$i]
$regTemp = StringRegExp($sLine, "YJ\d+", 3);用正则取机器名
$sName = $regTemp[0]
$regTemp = StringRegExp($sLine, "192\.168\.\d{1,3}\.\d{1,3}", 3);取ip(简陋了点....)
$sIP = $regTemp[0]
$regTemp = StringRegExp($sLine, "[a-f\d]{2}-[a-f\d]{2}-[a-f\d]{2}-[a-f\d]{2}-[a-f\d]{2}-[a-f\d]{2}", 3);取mac
$sMAC = $regTemp[0]
IniWrite("2.ini", "scan", $sName, $sIP & "|" & $sMAC);写入Ini
Next
|