VbsEdit, the award-winning VBScript editor that dramatically reduces the time you spend writing .VBS scripts

Sample scripts


Logs
   Plain-Text Logs
       Read a Comma Separated Values Log

' Read a Comma Separated Values Log



Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Windows\System32\DHCP\" & _
 "DhcpSrvLog-Mon.log", ForReading)

Wscript.Echo vbCrLf & "DHCP Records"

Do While objTextFile.AtEndOfStream <;>True
  strLine = objtextFile.ReadLine
  If inStr(strLine","Then
    arrDHCPRecord = split(strLine",")
    Wscript.Echo vbCrLf & "Event ID: " & arrDHCPRecord(0)
    Wscript.Echo "Date: " & arrDHCPRecord(1)
    Wscript.Echo "Time: " & arrDHCPRecord(2)
    Wscript.Echo "Description: " & arrDHCPRecord(3)
    Wscript.Echo "IP Address: " & arrDHCPRecord(4)
    Wscript.Echo "Host Name: " & arrDHCPRecord(5)
    Wscript.Echo "MAC Address: " & arrDHCPRecord(6)
    i = i + 1
  End If
Loop

Wscript.Echo vbCrLf & "Number of DHCP records read: " & i



VbsEdit includes all these samples!




Download Now!

Version 5.4.1 - This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit.
The evaluation version never expires.



Home   Buy Now   HtaEdit   Support   Video   What's new ?  

Copyright (C) 2001-2012 Adersoft