Hello Everyone,

I'm new to posting in this group and was hoping that I might be able to
get some assistance with an issue that I'm having.

Basically, what I'm doing is capturing AS/400 data with a software
called PlanetPress Watch and when I get this data I need to run it
through a VBScript to look for Index Values that will be grabbed and
passed to a variable, then eventually using the variables to create
delimited data file with path to a PDF, i.e.
"field1"~"field2"~"field3"~@@path\pdf.pdf.

My problem is that I've changed the script from using SkipLine and
Skip, just in case an extra CRLF or something appears in the data,
which would throw off the entire script in the fact that my Index
values would be blank. I've recently discovered the power of RegExp
and have been researching it over the past week to try and get a handle
on it. I think I'm to the point of understanding it, but am having
some issues with getting it to work in a VBScript. Part of my problem,
other than being a self-taught programmer, is reading in the data file
and passing it to a variable with the .ReadAll command. I think I may
have the .ReadAll command now, but it's the RegExp pattern that isn't
matching or something, even though it should match this: "CR\LF
ACLU5801S2341380", that is CR LF Space String.

Here's my code:
'**************************************************************

Option Explicit
Const ForReading = 1, ForWriting = 2

Dim x
Dim objFSO
Dim objInputFile, objOutputFile, objIn
Dim strTempName, strTempPath
Dim strLine, strLineBack1, strLineBack2
Dim ContainerNo, insertValue
Dim PhxRef, locationNumber, statementDate, counter, TypeBrokerage,
TypeBreakbulk
Dim DocNoP1, DocNoP2, DocNoP3, DocNoP4, DocNoP5, DocNoP6
Dim ShipperNo, ConsigneeNo, HAWBNo, AgentNo, AWBDate, MBillNo, HBillNo
Dim DocNoP11, DocNoP22, DocNoP33, DocNoP44, DocNoP55, DocNoP66
Dim fcount, lncount, skipln, strData, objIntro, strLineIn, DataLine

Set objFSO = CreateObject("Scripting.FileSystemObject")
'***NOTE: PW_GetJobFilename is a special function for PPW, that gets
the tempFileName of the datafile
Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
strTempPath = objFSO.GetFile(PW_GetJobFilename).ParentFolder.Path
strTempName = objFSO.GetTempName
Set objOutputFile =
objFSO.GetFolder(strTempPath).CreateTextFile(strTempName)
Dim ss, re, rv, objMatch, ColMatches, StrReturnStr
Set re = New RegExp
re.Pattern = "(\r\n\x20)([A-Z\d]{12,18})"
're.Pattern = "c."
re.Global = True
re.IgnoreCase = True
'Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
Do While objInputFile.AtEndOfStream <> True
strData = objInputFile.ReadLine
'***NOTE: Watch.ShowMessage is a special function for PPW, like MsgBox
'Watch.ShowMessage(strData)
Set ColMatches = re.Execute(strData)
Loop
For Each objMatch in ColMatches
StrReturnStr = objMatch.value
Watch.ShowMessage(StrReturnStr)
Next
'Loop
Watch.SetJobInfo 1, Chr(34) & "INV" & Chr(34) & Chr(126) & Chr(34) &
DocNoP1 & DocNoP2 & DocNoP3 & DocNoP4 & DocNoP5 & DocNoP6 & Chr(34) &
Chr(126) & Chr(34) & ShipperNo & Chr(34) & Chr(126) & Chr(34) &
"ConsigneeNo" & Chr(34) & Chr(126) & Chr(34) & "BOLNo" & Chr(34) &
Chr(126) & Chr(34) & "AgentNo" & Chr(34) & Chr(126) & Chr(34) & "Date"
& Chr(34) & Chr(126) & Chr(34) & "DocNo2" & Chr(34) & Chr(126) &
Chr(34) & "ContainerNo" & Chr(34) & Chr(126) & Chr(34) & HAWBNo &
Chr(34) & Chr(126) & Chr(34) & HBillNo & Chr(34) & Chr(126) & Chr(34) &
MBillNo & Chr(34) & Chr(126) & Chr(34) & "EntryNo" & Chr(34) & Chr(126)
& Chr(34) & "CustAcctNo" & Chr(34) & Chr(126) & Chr(34) & "ImporterNo"
& Chr(34) & Chr(126) & Chr(64) & Chr(64) & "D:\DocImport\INV\" &
Watch.GetJobInfo (9) & ".pdf"

objInputFile.Close
objOutputFile.Close
objFSO.DeleteFile PW_GetJobFilename, true
objFSO.MoveFile strTempPath & "\" & strTempName, PW_GetJobFileName
'**************************************************************

Any suggestions that you could give would be greatly appreciated.

Thanks in advance.

--Ken Stulce

Re: ReadAll and RegExp by McKirahan

McKirahan
Thu Jul 21 14:39:39 CDT 2005

"kstulce" <kstulce@gmail.com> wrote in message
news:1121971165.861026.166410@g14g2000cwa.googlegroups.com...
> Hello Everyone,
>
> I'm new to posting in this group and was hoping that I might be able to
> get some assistance with an issue that I'm having.
>
> Basically, what I'm doing is capturing AS/400 data with a software
> called PlanetPress Watch and when I get this data I need to run it
> through a VBScript to look for Index Values that will be grabbed and
> passed to a variable, then eventually using the variables to create
> delimited data file with path to a PDF, i.e.
> "field1"~"field2"~"field3"~@@path\pdf.pdf.
>
> My problem is that I've changed the script from using SkipLine and
> Skip, just in case an extra CRLF or something appears in the data,
> which would throw off the entire script in the fact that my Index
> values would be blank. I've recently discovered the power of RegExp
> and have been researching it over the past week to try and get a handle
> on it. I think I'm to the point of understanding it, but am having
> some issues with getting it to work in a VBScript. Part of my problem,
> other than being a self-taught programmer, is reading in the data file
> and passing it to a variable with the .ReadAll command. I think I may
> have the .ReadAll command now, but it's the RegExp pattern that isn't
> matching or something, even though it should match this: "CR\LF
> ACLU5801S2341380", that is CR LF Space String.
>
> Here's my code:
> '**************************************************************
>
> Option Explicit
> Const ForReading = 1, ForWriting = 2
>
> Dim x
> Dim objFSO
> Dim objInputFile, objOutputFile, objIn
> Dim strTempName, strTempPath
> Dim strLine, strLineBack1, strLineBack2
> Dim ContainerNo, insertValue
> Dim PhxRef, locationNumber, statementDate, counter, TypeBrokerage,
> TypeBreakbulk
> Dim DocNoP1, DocNoP2, DocNoP3, DocNoP4, DocNoP5, DocNoP6
> Dim ShipperNo, ConsigneeNo, HAWBNo, AgentNo, AWBDate, MBillNo, HBillNo
> Dim DocNoP11, DocNoP22, DocNoP33, DocNoP44, DocNoP55, DocNoP66
> Dim fcount, lncount, skipln, strData, objIntro, strLineIn, DataLine
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> '***NOTE: PW_GetJobFilename is a special function for PPW, that gets
> the tempFileName of the datafile
> Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
> strTempPath = objFSO.GetFile(PW_GetJobFilename).ParentFolder.Path
> strTempName = objFSO.GetTempName
> Set objOutputFile =
> objFSO.GetFolder(strTempPath).CreateTextFile(strTempName)
> Dim ss, re, rv, objMatch, ColMatches, StrReturnStr
> Set re = New RegExp
> re.Pattern = "(\r\n\x20)([A-Z\d]{12,18})"
> 're.Pattern = "c."
> re.Global = True
> re.IgnoreCase = True
> 'Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
> Do While objInputFile.AtEndOfStream <> True
> strData = objInputFile.ReadLine
> '***NOTE: Watch.ShowMessage is a special function for PPW, like MsgBox
> 'Watch.ShowMessage(strData)
> Set ColMatches = re.Execute(strData)
> Loop
> For Each objMatch in ColMatches
> StrReturnStr = objMatch.value
> Watch.ShowMessage(StrReturnStr)
> Next
> 'Loop
> Watch.SetJobInfo 1, Chr(34) & "INV" & Chr(34) & Chr(126) & Chr(34) &
> DocNoP1 & DocNoP2 & DocNoP3 & DocNoP4 & DocNoP5 & DocNoP6 & Chr(34) &
> Chr(126) & Chr(34) & ShipperNo & Chr(34) & Chr(126) & Chr(34) &
> "ConsigneeNo" & Chr(34) & Chr(126) & Chr(34) & "BOLNo" & Chr(34) &
> Chr(126) & Chr(34) & "AgentNo" & Chr(34) & Chr(126) & Chr(34) & "Date"
> & Chr(34) & Chr(126) & Chr(34) & "DocNo2" & Chr(34) & Chr(126) &
> Chr(34) & "ContainerNo" & Chr(34) & Chr(126) & Chr(34) & HAWBNo &
> Chr(34) & Chr(126) & Chr(34) & HBillNo & Chr(34) & Chr(126) & Chr(34) &
> MBillNo & Chr(34) & Chr(126) & Chr(34) & "EntryNo" & Chr(34) & Chr(126)
> & Chr(34) & "CustAcctNo" & Chr(34) & Chr(126) & Chr(34) & "ImporterNo"
> & Chr(34) & Chr(126) & Chr(64) & Chr(64) & "D:\DocImport\INV\" &
> Watch.GetJobInfo (9) & ".pdf"
>
> objInputFile.Close
> objOutputFile.Close
> objFSO.DeleteFile PW_GetJobFilename, true
> objFSO.MoveFile strTempPath & "\" & strTempName, PW_GetJobFileName
> '**************************************************************
>
> Any suggestions that you could give would be greatly appreciated.
>
> Thanks in advance.
>
> --Ken Stulce

Not sure about your code; but for ReadAll ....

Will this help at all? Watch for word-wrap.

Option Explicit
'*
'* Declare Constants
'*
Const cVBS = "PW.vbs"
'*
Const ForReading = 1
Const ForWriting = 2
'*
'* Declare Variables
'*
Dim strData
Dim strFile
strFile = PW_GetJobFilename
Dim strName
Dim strPath
Dim strTest
strTest = vbCrLf & " ACLU5801S2341380"
'*
'* Declare Objects
'*
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objOT1
'*
'* Process
'*
If objFSO.FileExists(strFile) Then
Set objOT1 = objFSO.OpenTextFile(strFile,ForReading)
strData = objOT1.ReadAll()
strPath = objFSO.GetFile(strFile).ParentFolder.Path
strName = objFSO.GetTempName
If InStr(strData,strTest) > 0 Then
WScript.Echo strTest & vbCrLf & "does exist in file."
Else
WScript.Echo strTest & vbCrLf & "does not exist in file."
End If
Set objOT1 = Nothing
End If
'*
'* Destroy Objects
'*
Set objFSO = Nothing
'*
'* Finish
'*
MsgBox "Done!",vbInformation,cVBS

Function PW_GetJobFilename()
***NOTE: PW_GetJobFilename is a special function for PPW, that gets the
FileName of the datafile
PW_GetJobFilename = "C:\temp\filename.txt"
End Function



Re: ReadAll and RegExp by kstulce

kstulce
Thu Jul 21 15:27:57 CDT 2005

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


Re: ReadAll and RegExp by James

James
Thu Jul 21 16:40:03 CDT 2005

"kstulce" <kstulce@gmail.com> wrote in message
news:1121977677.882044.298610@g49g2000cwa.googlegroups.com...
> 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.

I don't quite understand what the pattern you are looking for is. Please
describe in detail what you expect your pattern to match. Give a few
examples of what should match and what should not?



Re: ReadAll and RegExp by kstulce

kstulce
Thu Jul 21 21:29:31 CDT 2005

James,

Thanks for your response.

The pattern that I'm searching for "(\r\n\x20)([A-Z\d]{12,18})", is
looking for a preceeding CRLFSpace then any combination of uppercase
characters and/or digits equaling a minimum of 12 characters and a
maximum of 18 characters. I'm looking for a combination like "
ACLU5801S2341380". Nothing in the entire datastream will match this
combination, as it is always found on the left side of the data and
will start at column two, with a preceeding CR\LF then space. Looking
at the data more indepth, the string is actually preceeded by the word
"CONTAINER" then a CR/LF then a Space.

I would like to post the entire original datastream, but due to
confidentiality, I cannot, as it is a Shipping Invoice from a customer
of mine.

Here is a partial sample of the Invoice with the string I'm looking
for:
'******************************************
CARRIER....... ATLANTIC CONTAINER LINES
VESSEL/VOYAGE. ROTTERDAM EXPRESS V.058
MASTER CONTAINER MASTER CONTAINER
ACLU5801S2341380 GCNU 4638423
HOUSE BILL.... BES05010036
ETD........... 30 JAN 05 THAMESPORT, ENGLAND ORIGIN COUNTRY.. UNITED
KINGDOM
'******************************************
NOTE: In case it doesn't show on screen correction, "UNITED KINGDOM" is
on the same line and doesn't have a CR/LF between it. The newsgroup
may perform a wordwrap.

As you can see, I don't really have any beginning or ending static text
to look for, but the Master Number will always be between 12 and 18
alphanumeric characters. I could look for the string " MASTER
CONTAINER" then skip a line and grab from column 2 to 18, but I
would prefer to try and capture it within a regular expression.

Hopefully this helps with explaining what I'm trying to capture.
Please let me know if you have any additional questions.

Thanks again for your help.

--Ken Stulce


Re: ReadAll and RegExp by kstulce

kstulce
Thu Jul 21 21:35:37 CDT 2005

James,

Also I wanted to note, it looks like the newsgroup also uses a font
that is not equally spaced. To see the data in its original state,
past into a text editor and change the font to Courier.

Thanks,

--Ken Stulce


Re: ReadAll and RegExp by James

James
Fri Jul 22 08:18:15 CDT 2005

Give this a try and report back your results:

re.Pattern = "\n [A-Z\d]{12,18}"

"kstulce" <kstulce@gmail.com> wrote in message
news:1121999371.084022.253030@g49g2000cwa.googlegroups.com...
> James,
>
> Thanks for your response.
>
> The pattern that I'm searching for "(\r\n\x20)([A-Z\d]{12,18})", is
> looking for a preceeding CRLFSpace then any combination of uppercase
> characters and/or digits equaling a minimum of 12 characters and a
> maximum of 18 characters. I'm looking for a combination like "
> ACLU5801S2341380". Nothing in the entire datastream will match this
> combination, as it is always found on the left side of the data and
> will start at column two, with a preceeding CR\LF then space. Looking
> at the data more indepth, the string is actually preceeded by the word
> "CONTAINER" then a CR/LF then a Space.
>
> I would like to post the entire original datastream, but due to
> confidentiality, I cannot, as it is a Shipping Invoice from a customer
> of mine.
>
> Here is a partial sample of the Invoice with the string I'm looking
> for:
> '******************************************
> CARRIER....... ATLANTIC CONTAINER LINES
> VESSEL/VOYAGE. ROTTERDAM EXPRESS V.058
> MASTER CONTAINER MASTER CONTAINER
> ACLU5801S2341380 GCNU 4638423
> HOUSE BILL.... BES05010036
> ETD........... 30 JAN 05 THAMESPORT, ENGLAND ORIGIN COUNTRY.. UNITED
> KINGDOM
> '******************************************
> NOTE: In case it doesn't show on screen correction, "UNITED KINGDOM" is
> on the same line and doesn't have a CR/LF between it. The newsgroup
> may perform a wordwrap.
>
> As you can see, I don't really have any beginning or ending static text
> to look for, but the Master Number will always be between 12 and 18
> alphanumeric characters. I could look for the string " MASTER
> CONTAINER" then skip a line and grab from column 2 to 18, but I
> would prefer to try and capture it within a regular expression.
>
> Hopefully this helps with explaining what I'm trying to capture.
> Please let me know if you have any additional questions.
>
> Thanks again for your help.
>
> --Ken Stulce
>



Re: ReadAll and RegExp by kstulce

kstulce
Fri Jul 22 09:01:18 CDT 2005

James,

Thanks again for your reply.

I tried the pattern, but didn't get any results.

Here's a cleaned up version of my script with the new pattern:

'*********************************************************
Option Explicit
Const ForReading = 1, ForWriting = 2

Dim objFSO
Dim objInputFile, objOutputFile, strData
Dim strTempName, strTempPath
Dim ContainerNo
Dim PhxRef, locationNumber, statementDate
Dim DocNoP1, DocNoP2, DocNoP3, DocNoP4, DocNoP5, DocNoP6
Dim ShipperNo, ConsigneeNo, HAWBNo, AgentNo, AWBDate, MBillNo, HBillNo,
INVNo
Dim DocNoP11, DocNoP22, DocNoP33, DocNoP44, DocNoP55, DocNoP66
Dim INVNoPOS, PHXRefPOS, MBILLNoPOS, HBILLNoPOS, ShipperNoPOS

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
strTempPath = objFSO.GetFile(PW_GetJobFilename).ParentFolder.Path
strTempName = objFSO.GetTempName
Set objOutputFile =
objFSO.GetFolder(strTempPath).CreateTextFile(strTempName)
Dim re, objMatch, ColMatches, StrReturnStr
Set re = New RegExp
re.Pattern = "\n [A-Z\d]{12,18}"
re.Global = True
re.IgnoreCase = True
Do While Not objInputFile.AtEndOfStream
strData = objInputFile.ReadLine
'INVNoPOS = Instr(strData, "INVOICE NO......")
'If(INVNoPOS > 0) then
'INVNo = Mid(strData, INVNoPOS + 16, 14)
'ShipperNo = mid(strData,1,6)
'End If
'PHXRefPOS = Instr(strData, "PHOENIX REF.....")
'If(PHXRefPOS > 0) then
'DocNoP1 = Mid(strData, PHXRefPOS + 16, 14)
'ShipperNo = mid(strData,1,6)
'End If
Set ColMatches = re.Execute(strData)
For Each objMatch in ColMatches
StrReturnStr = objMatch.value
Watch.ShowMessage(StrReturnStr)
Next
Loop
'Watch.ShowMessage(INVNo)
'Watch.ShowMessage(ShipperNo)

Watch.SetJobInfo 1, Chr(34) & "INV" & Chr(34) & Chr(126) & Chr(34) &
DocNoP1 & DocNoP2 & DocNoP3 & DocNoP4 & DocNoP5 & DocNoP6 & Chr(34) &
Chr(126) & Chr(34) & ShipperNo & Chr(34) & Chr(126) & Chr(34) &
"ConsigneeNo" & Chr(34) & Chr(126) & Chr(34) & "BOLNo" & Chr(34) &
Chr(126) & Chr(34) & "AgentNo" & Chr(34) & Chr(126) & Chr(34) & "Date"
& Chr(34) & Chr(126) & Chr(34) & "DocNo2" & Chr(34) & Chr(126) &
Chr(34) & "ContainerNo" & Chr(34) & Chr(126) & Chr(34) & HAWBNo &
Chr(34) & Chr(126) & Chr(34) & HBillNo & Chr(34) & Chr(126) & Chr(34) &
MBillNo & Chr(34) & Chr(126) & Chr(34) & "EntryNo" & Chr(34) & Chr(126)
& Chr(34) & "CustAcctNo" & Chr(34) & Chr(126) & Chr(34) & "ImporterNo"
& Chr(34) & Chr(126) & Chr(64) & Chr(64) & "D:\DocImport\INV\" &
Watch.GetJobInfo (9) & ".pdf"

objInputFile.Close
objOutputFile.Close
objFSO.DeleteFile PW_GetJobFilename, true
objFSO.MoveFile strTempPath & "\" & strTempName, PW_GetJobFileName
'*********************************************************

Since I'm on a deadline, I have to create the script with INSTR
commands and other searchable methods until I get the RegEx thing
figured out. I'm still wanting to test any ideas that are presented to
me, though, as I think the theory of RegEx will help me out more so in
the long run.

Any other ideas?

Thanks in advance.

--Ken Stulce


Re: ReadAll and RegExp by James

James
Fri Jul 22 09:20:27 CDT 2005

I am not completely surprised. By simply copying the example text you
pasted into your message & pasting it into a text document, I might have
different end-of-lines than you do (just CR instead of CR & LF, etc). Try
doing either or both of these things: #1 - resubmit your example text to the
newsgroup, but attach it to the message as an attachment rather than pasting
the text into the body of the message. This way, I know I am working with
your text exactly. When you create the example, make sure you are trimming
the confidential data out of the original document instead of copying it &
pasting it into another text file. #2 - Try this variation of the regular
expression pattern:

re.Pattern = "[\n\r\f] [A-Z\d]{12,18}"

"kstulce" <kstulce@gmail.com> wrote in message
news:1122040799.455184.262290@z14g2000cwz.googlegroups.com...
> James,
>
> Thanks again for your reply.
>
> I tried the pattern, but didn't get any results.
>
> Here's a cleaned up version of my script with the new pattern:
>
> '*********************************************************
> Option Explicit
> Const ForReading = 1, ForWriting = 2
>
> Dim objFSO
> Dim objInputFile, objOutputFile, strData
> Dim strTempName, strTempPath
> Dim ContainerNo
> Dim PhxRef, locationNumber, statementDate
> Dim DocNoP1, DocNoP2, DocNoP3, DocNoP4, DocNoP5, DocNoP6
> Dim ShipperNo, ConsigneeNo, HAWBNo, AgentNo, AWBDate, MBillNo, HBillNo,
> INVNo
> Dim DocNoP11, DocNoP22, DocNoP33, DocNoP44, DocNoP55, DocNoP66
> Dim INVNoPOS, PHXRefPOS, MBILLNoPOS, HBILLNoPOS, ShipperNoPOS
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objInputFile = objFSO.OpenTextFile(PW_GetJobFilename, 1)
> strTempPath = objFSO.GetFile(PW_GetJobFilename).ParentFolder.Path
> strTempName = objFSO.GetTempName
> Set objOutputFile =
> objFSO.GetFolder(strTempPath).CreateTextFile(strTempName)
> Dim re, objMatch, ColMatches, StrReturnStr
> Set re = New RegExp
> re.Pattern = "\n [A-Z\d]{12,18}"
> re.Global = True
> re.IgnoreCase = True
> Do While Not objInputFile.AtEndOfStream
> strData = objInputFile.ReadLine
> 'INVNoPOS = Instr(strData, "INVOICE NO......")
> 'If(INVNoPOS > 0) then
> 'INVNo = Mid(strData, INVNoPOS + 16, 14)
> 'ShipperNo = mid(strData,1,6)
> 'End If
> 'PHXRefPOS = Instr(strData, "PHOENIX REF.....")
> 'If(PHXRefPOS > 0) then
> 'DocNoP1 = Mid(strData, PHXRefPOS + 16, 14)
> 'ShipperNo = mid(strData,1,6)
> 'End If
> Set ColMatches = re.Execute(strData)
> For Each objMatch in ColMatches
> StrReturnStr = objMatch.value
> Watch.ShowMessage(StrReturnStr)
> Next
> Loop
> 'Watch.ShowMessage(INVNo)
> 'Watch.ShowMessage(ShipperNo)
>
> Watch.SetJobInfo 1, Chr(34) & "INV" & Chr(34) & Chr(126) & Chr(34) &
> DocNoP1 & DocNoP2 & DocNoP3 & DocNoP4 & DocNoP5 & DocNoP6 & Chr(34) &
> Chr(126) & Chr(34) & ShipperNo & Chr(34) & Chr(126) & Chr(34) &
> "ConsigneeNo" & Chr(34) & Chr(126) & Chr(34) & "BOLNo" & Chr(34) &
> Chr(126) & Chr(34) & "AgentNo" & Chr(34) & Chr(126) & Chr(34) & "Date"
> & Chr(34) & Chr(126) & Chr(34) & "DocNo2" & Chr(34) & Chr(126) &
> Chr(34) & "ContainerNo" & Chr(34) & Chr(126) & Chr(34) & HAWBNo &
> Chr(34) & Chr(126) & Chr(34) & HBillNo & Chr(34) & Chr(126) & Chr(34) &
> MBillNo & Chr(34) & Chr(126) & Chr(34) & "EntryNo" & Chr(34) & Chr(126)
> & Chr(34) & "CustAcctNo" & Chr(34) & Chr(126) & Chr(34) & "ImporterNo"
> & Chr(34) & Chr(126) & Chr(64) & Chr(64) & "D:\DocImport\INV\" &
> Watch.GetJobInfo (9) & ".pdf"
>
> objInputFile.Close
> objOutputFile.Close
> objFSO.DeleteFile PW_GetJobFilename, true
> objFSO.MoveFile strTempPath & "\" & strTempName, PW_GetJobFileName
> '*********************************************************
>
> Since I'm on a deadline, I have to create the script with INSTR
> commands and other searchable methods until I get the RegEx thing
> figured out. I'm still wanting to test any ideas that are presented to
> me, though, as I think the theory of RegEx will help me out more so in
> the long run.
>
> Any other ideas?
>
> Thanks in advance.
>
> --Ken Stulce
>



Re: ReadAll and RegExp by Dr

Dr
Sat Jul 23 12:03:32 CDT 2005

JRS: In article <1121999737.021882.138230@z14g2000cwz.googlegroups.com>
, dated Thu, 21 Jul 2005 19:35:37, seen in news:microsoft.public.scripti
ng.vbscript, kstulce <kstulce@gmail.com> posted :
>
>Also I wanted to note, it looks like the newsgroup also uses a font
>that is not equally spaced. To see the data in its original state,
>past into a text editor and change the font to Courier.

Newsgroups do not use fonts; that's the responsibility of the displaying
software.

At least in technical newsgroups, one is expected to use a fixed-pitch
font, but not necessarily Courier - for both writing and reading.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.