Re: VB Script that searches a file for different text, with an app

Tech-Archive recommends: Fix windows errors by optimizing your registry





"Pegasus (MVP)" wrote:


"njmike" <njmike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A0DC18CE-BF54-4C1E-A78F-32D7A4676F22@xxxxxxxxxxxxxxxx
I'm trying to do the following and not having much luck.

I need a script that opens a text log, once opened it searches for a
unique
identifyer that resides near the top of the file and looks something like
this:

"running with process name
USSECAVDMPAPP1Cell01\USSECAVDMPAPP28Node01\server55" (I'm only really
interested in the "server55" piece, but can make due with the entire
string.

The script then needs to continue parsing the file for error conditions
which look like this:

"There is/are 1 thread(s) in total in the server that may be hung"

There could be multiple instances of that error message.

What I would like to do is write to a seperate file the uniqueID, pluss
error message, something similiar to this:

There is/are 1 thread(s) in total in the server that may be hung on
server55.


Any assistance would be greatly appreciated.

Regards,

Mike


Let's have a look at what you've got so far. We can probably built in that.

Appreciate your time Pegasus, Here's what I have so far:

Const ForReading = 1

Set objFSo = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("testIn.txt")

Do Until objFile.AtEndOfStream
strText = objFile.ReadLine
If InStr(strText, "running with process name") Then
arrText = Split(strText, "and process id")
strVariable = arrText(0)
'Exit Do
ElseIf InStr(strText, "There is/are") Then
arrText = Split(strText, "in total in the server")
strVariable1 = arrText(0)
Exit Do
End If
Loop








objFile.Close

Wscript.Echo strVariable
Wscript.Echo strVariable1

The issue this is having is its grabbing the right server string and echoing
that back, then it gets the error info - but only the first instance of it.
There are multiple instances after, which I can't get it to loop to.


.



Relevant Pages

  • Re: Help with Net::ftp not downloading
    ... download a set of files from my server to my local drive. ... getting any error messages, the script isn't performing. ... I added the error message trap, an lo, I get an error ... Web server, then 'use CGI' will help, otherwise you'll have ...
    (comp.lang.perl.misc)
  • Re: SMTPClient Message.Send Error - please help!!!
    ... prevent my script from failing... ... Maybe their smtp server is experiencing considerable load and that is ... - script is below the error message below... ... S> Service not available, closing transmission channel. ...
    (microsoft.public.dotnet.framework)
  • Re: Error 800703e6 CDO.Person
    ... Anything change on the server? ... >> Why are you using CreateObject instead of Server.CreateObject? ... >>> I am using asp script for enumerating mailboxes in certain OU. ... >>> and the error message: ...
    (microsoft.public.exchange.development)
  • Re: The folloing javascript code does not compile.
    ... Error message is that cc ... As Bruce said, this is a server side code error, which means that you are ... be script but why isn't <!-- taken to be script? ... The start tag of the comment is ignored in the script, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: List of Network Shares
    ... "Pegasus (MVP)" wrote: ... run it on each server with Mom. ... if you have any ready to use script ...
    (microsoft.public.scripting.vbscript)