本帖最后由 PEM-System 于 2013-9-10 13:53 编辑
以下是1.txt的内容
=================================
USB\VID_0BDA&PID_0139\20100201396000000
Name: USB2.0-CRW
The device has the following problem: 28
PCI\VEN_10DE&DEV_0DF4&SUBSYS_15F21043&REV_A1\4&CAD05E7&0&0008
Name: The device has the following problem: 01
=========================================#include <array.au3>
#include <file.au3>
Local $var = FileOpenDialog("请选择要开启的档案", "c:\data", " TXT(*.txt) ")
Local $file = FileOpen($var)
$line = FileRead($file)
Local $str2 = StringRegExpReplace($line, "Name: *","" )
$str = StringRegExp($str2, ".*\\.*\n.*The\sdevice.*", 3)
_ArrayDisplay($str)
显示的是这样 为什么不配对另外一条呢
PCI\VEN_10DE&DEV_0DF4&SUBSYS_15F21043&REV_A1\4&CAD05E7&0&0008 The device has the following problem: 01
而我希望得到下面的内容
USB\VID_0BDA&PID_0139\20100201396000000 The device has the following problem: 28
PCI\VEN_10DE&DEV_0DF4&SUBSYS_15F21043&REV_A1\4&CAD05E7&0&0008 The device has the following problem: 01
大家帮忙看看哪里出错了 |