Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grab multiple line data from log file
#1
Not Solved
Actually I am doing automation on PuttY which it will login to putty and grab a certain data for me. But it only grab the first line output of the command. Can you please help me out?The data are grab from the log file of the putty. My current code :
Quote:Function GrabShSNMP
Const ForReading = 1
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "show snmp community"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(Environment("logfile"), ForReading)
Do Until objFile.AtEndOfStream

    strSearchString = objFile.ReadLine

    Set colMatches = objRegEx.Execute(strSearchString)

    If colMatches.Count > 0 Then
    strSearchString = objFile.ReadLine
    Datatable.value("SNMP_Mode",dtGlobalsheet) = strSearchString

    End If
Loop
objFile.Close
Set objRegEx = Nothing
Set objFSO = Nothing
Set objFile = Nothing
End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Fifth word from every thousand line in notepad files. sallu.iet@gmail.com 0 836 01-17-2020, 09:58 AM
Last Post: sallu.iet@gmail.com
  Multiple rows of test data Bhuvana 0 1,126 01-03-2020, 09:30 PM
Last Post: Bhuvana
  dtLocalSheet empty even though excel file contains data cantorre 2 2,193 05-10-2017, 12:47 PM
Last Post: vidhi
  Using external data source for multiple actions Neetha 0 1,675 10-26-2015, 06:23 AM
Last Post: Neetha
  Not Able to Grab Objects pacific316 2 2,290 05-23-2014, 04:13 PM
Last Post: excellentpawan123

Forum Jump:


Users browsing this thread: 1 Guest(s)