I did some more searching and this is what I have so far. I am sure others may want to do the same. It works, now I just need to get it posted into the form for the DB and create a table...
[code]Dim fso,fold,fil,Absolute,Relative,latestDate,latestName,Line,arrLine
Set fso = CreateObject("Scripting.FileSystemObject") Set fold = fso.GetFolder("C:\TestFolder")
For each fil in fold.Files if Mid(lcase(fil.Name),Instrrev(fil.Name,".")) = ".log" Then if latestDate = "" Then latestDate = fil.DateLastModified latestName = fil.Name Else if fil.DateLastModified > latestDate Then latestDate = fil.DateLastModified latestName = fil.Name end if End if End if Next s if latestName <> "" Then latestName = fold.path & "\" & latestName Set fil = fso.OpenTextFile(latestname) While Not fil.AtEndOfStream Line = fil.ReadLine if instr(Lcase(Line),"absolute") Then arrLine = Split(Line,":") Absolute = arrLine(2) end If if instr(Lcase(Line),"relative") Then arrLine = Split(Line,":") Relative = arrLine(2) end If Wend fil.Close End if
MsgBox "Absolute = " & Absolute MsgBox "Relative = " & Relative
Set fold = Nothing Set fso = Nothing[/code]
|