蛋疼,试试vbs先,明天再说- Set fso = CreateObject("Scripting.FileSystemObject")
- strKey ="D *11 Final seasonally adjusted data"
-
- For Each file in fso.GetFolder(".").Files
- If LCase(Right(file.Name,4)) = ".txt" Then
- RegEx fso.OpenTextFile(file).ReadAll
- End If
- Next
-
- Sub RegEx(text)
- Set re = New RegExp
- re.Pattern = strKey & "[\s\S]+?([^ ]+) +[^ ]+\s+AVGE"
- re.IgnoreCase = True
- For Each a In re.Execute(text)
- fso.OpenTextFile("Result.txt",8,True).WriteLine a.SubMatches(0)
- Next
- End Sub
复制代码
|