|
|
|
date: 14 Dec 2005 09:38:48 -0800,
group: microsoft.public.inetsdk.programming.scripting.vbscript
back
Re: parse string into variables
mmethe@gmail.com wrote:
> I want to create 3 test variables from this line:
>
> ***PRINTED=>12/14/2005*** Document 167, Book1 owned by USERNAME was
> printed on im2020_PW_Admin via port IP_10.2.1.245. Size in bytes:
> 410088; pages printed: 10
>
> -username will be set to USERNAME
> -size will be set to 4100088
> -pages will be set to 10
>
> I know I can do a series of InStr and Left and Right functions but I
> just can wrap my head around it!
>
> Help! Thanks!
>
Here's a quick example
dim s, ar1, ar2, username
s="***PRINTED=>12/14/2005*** Document 167, " & _
"Book1 owned by USERNAME was printed on " &
"im2020_PW_Admin via port IP_10.2.1.245. Size in bytes: " & _
"410088; pages printed: 10"
ar1=split(s,"owned by ")
ar2=split(ar(1)," was printed")
username=ar2(0)
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
date: Wed, 14 Dec 2005 13:41:20 -0500
author: Bob Barrows [MVP] com
|
|