Dim i%, j%, Var$, arr() As String
Path = ThisWorkbookPath & "\"
f = Dir(Path & "htm")
Do While f <> ""
Open Path & f For Input As #1
s = Split(Replace(StrConv(InputB(LOF(1), 1), vbUnicode), Chr(9), ""), ">")
Close #1
For i = 0 To UBound(s)
If InStr(s(i), "</title") Then
Var = "" & Split(Split(s(i), "<")(0), "")(1)
j = j + 1
ReDim Preserve arr(1 To 2, 1 To j)
arr(1, j) = "文件名" & j
arr(2, j) = Var
Exit For
End If
Next
f = Dir()
Loop
Sheet1[a1]Resize(UBound(arr, 2), 2) = WorksheetFunctionTranspose(arr)
End SuB
将以上代码放到工作表中,你也看看下这个帖子v
>
图样。win7自带一个字符串查找的工具findstrexe
findstr /r /i "\<<title></title>\>" %1 >> goodtxtfindstr /r /i "\<<meta name="keyword"/>\>" %1 >> goodtxt
再新建一个gobat 内容如下
for /r %%a in (html) do fsbat %%a把这两个文件放到保存html文件的文件夹,运行gobat即可。
所以结果会自动保存到goodtxt中。
-------------------------------------------------------完结-------------------------------------------
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)