- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¥»©«³Ì«á¥Ñ stillfish00 ©ó 2016-11-9 17:20 ½s¿è
¦^´_ 2# wwwlen2002
¥u³B²zcms_value_####.xml
XML_PATH ¦Û¦æ§ï¬°¥¿½T¸ô®|
°Ñ¦Ò :- Sub Test()
- Dim t: t = Timer
-
- Const XML_PATH = "C:\Users\xxxxx\Downloads\CMS\CMS\20150101"
- Dim oXml As Object: Set oXml = CreateObject("msxml2.domdocument")
- Dim sFile As String, sTime As String, sCmsid As String, sMessage As String
- Dim oNodes As Object, arData, cnt As Long
- ReDim arData(1 To 3, 1 To 1)
- sFile = Dir(XML_PATH & "\")
- Do While Len(sFile) > 0
- If sFile Like "cms_value_####.xml" Then
- oXml.Load XML_PATH & "\" & sFile
- With oXml.ChildNodes(1)
- sTime = .getAttribute("updatetime")
- Set oNodes = .getElementsbyTagName("Info")
- ReDim Preserve arData(1 To 3, 1 To UBound(arData, 2) + oNodes.Length)
- For Each x In oNodes
- sMessage = WorksheetFunction.Asc(x.getAttribute("message")) '¥þ§ÎÂà¥b§Î
- If HasMyKeyWords(sMessage) Then
- sCmsid = x.getAttribute("cmsid")
- cnt = cnt + 1
- arData(1, cnt) = sTime
- arData(2, cnt) = sCmsid
- arData(3, cnt) = sMessage
- End If
- Next
- ReDim Preserve arData(1 To 3, 1 To cnt)
- End With
- End If
- sFile = Dir()
- Loop
-
- If cnt > 0 Then
- With Sheets.Add(After:=Sheets(Sheets.Count))
- .[a1].Resize(1, 3) = Array("updatetime", "cmsid", "message")
- .[a2].Resize(cnt, 3) = Application.Transpose(arData)
- .UsedRange.Columns.AutoFit
- End With
- End If
-
- MsgBox "°õ¦æ®É¶¡ " & Timer - t & " ¬í", vbOKOnly
- End Sub
- Function HasMyKeyWords(s As String) As Boolean
- For Each x In Array("¾Ã¶ë", "K", "k", "«B", "¤ÑÔ¤£¨Î")
- If InStr(1, s, x) > 0 Then
- HasMyKeyWords = True
- Exit Function
- End If
- Next
- HasMyKeyWords = False
- End Function
½Æ»s¥N½X |
|