Re: ReadAll and RegExp

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



McKirahan,

Thanks for your reply.

I should rephrase some of my notes. I said "function", but it's
actually a special command for PlanetPress Watch to work with a
VBScript. When PlanetPress Watch captures the AS/400 ASCII data, it
makes a copy to a temp folder with a temp name and works off of the
temp file. The VBScript is actually grabbing the temp file, via the
PW_GetJobFilename command, and working with it.

Have you used Regular Expressions in a VBScript? I purchase the
program "RegExBuddy" to help me learn how to create the patterns, based
upon a text file, but the patterns that I have come up with, i.e.
re.Pattern = "(\r\n\x20)([A-Z\d]{12,18})", don't seem to be working,
even though I'm using expressions straight out of the VBScript CHM
manual from M$. This expression works fine in RegExBuddy, but doesn't
work in the script. I can use a pattern like "c." and it will pull up
a bunch of stuff.

For the ReadAll problem, I just switched to ReadLine in a Do Loop and
it's reading all of the data. This is probably better, as it is only
reading what it needs versus the entire datastream, which the majority
probably won't be needed.

Is there a way to move the pointer back to the top if the entire
datastream is read into a variable? It doesn't sound like there is,
but wanted to ask anyway. A colleague of mine said there is a way, but
of course he was driving and couldn't remember the commands off of the
top of his head.

Thanks again for your help.

--Ken

.



Relevant Pages

  • Re: Need WMI script
    ... Error handling in VBScript is obviously not as good as in .NET. ... normal error handling with "On Error GoTo 0". ... Dim adoCommand, adoConnection, strBase, strFilter, strAttributes, xmlDoc, ... you can use a command similar to below at a command ...
    (microsoft.public.windows.server.scripting)
  • Re: Need WMI script
    ... How to handle the errors in vbscript. ... Dim strDomainName, strNodeText, strXmlBuilder ... However, if you use the cscript host, ... you can use a command similar to below at a command prompt: ...
    (microsoft.public.windows.server.scripting)
  • Re: wsharguments length limit?
    ... pasted it into a batch file, changed the path to the VBScript to one on my ... When I pasted your command I noted there were spaces between each argument, ... Could SAS be ... Set objXL = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: system.Diagnostics.Process Problem
    ... Dim consoleApp As New Process ... Loop Until consoleApp.MainWindowTitle.ToString.EndsWith ... command sent to the cmd.exe) but I am not clear on your response. ... then attempt to read the output from the VBScript using ...
    (microsoft.public.dotnet.general)
  • Re: system.Diagnostics.Process Problem
    ... Thanks for you response. ... processing the previous command that was sent so that I may send another one. ... Dim objProcess As Process ... EndOfStream is not reached when VBScript ends only when cmd.exe ...
    (microsoft.public.dotnet.general)