Dim Fs, xl,book, C, Inp, regEx, Lines, WULog, Matches Dim k, I, J, Mes, slot
If Wscript.Arguments.Count<>1 Then msgbox "UDm Logs フォルダをドロップしてください。"
Set Fs = CreateObject("Scripting.FileSystemObject") Set xl = CreateObject("Excel.Application") Set book = xl.Workbooks.Add Set C = book.worksheets(1).Cells xl.Visible = True With book.worksheets(1) .Columns(6).NumberFormatLocal = "[h]:mm:ss" .Columns(7).NumberFormatLocal = "[mm]:ss" .Columns(1).ColumnWidth = 16.25 End With Set regEx = New RegExp regEx.Global = True
regEx.Pattern = "([\d|/]+)\s([\d|:]+):\s(.+)\r\n" Set Inp = Fs.OpenTextFile(wscript.arguments(0) & "\Log.txt", 1 ) Set Lines = regEx.Execute(Inp.ReadAll) Inp.Close
For J = 0 To WULog.Count - 1 If WULog(J).SubMatches(0)=Lines(I).SubMatches(0) And WULog(J).SubMatches(1)=Lines(I).SubMatches(1) Then C(k, 4) = WULog(J).SubMatches(5) C(k, 5) = WULog(J).SubMatches(2) C(k, 9) = WULog(J).SubMatches(3) C(k, 10) = WULog(J).SubMatches(4) Exit For End If Next k = k+1 n(slot-1) = 0 sum(slot-1) = 0 ElseIf Left( Mes ,2) = "Re" Then 'Resetting slot=CutOut(Mes,"#",".") n(slot-1) = 0 sum(slot-1) = 0 End If Next
Function CutOut(str,istr,estr) CutOut = Mid(str, InStr(str,istr)+Len(istr), InStr(str,estr)-InStr(str,istr)-Len(istr) ) End Function