Re: ACT scripting
From: sunil (sunil.madamsetty_at_gmail.com)
Date: 09/24/04
- Next message: Daryl: "Ip address to dword conversion"
- Previous message: Dr John Stockton: "Re: string manipulation experts..."
- In reply to: ganesh: "Re: ACT scripting"
- Next in thread: ganesh: "Re: ACT scripting"
- Reply: ganesh: "Re: ACT scripting"
- Messages sorted by: [ date ] [ thread ]
Date: 24 Sep 2004 11:58:28 -0700
Hi Ganesh,
Thanks again for ur precious time. I really appriciate your help
While executing the the script send by you..I am getting the following
error.
---------------------------------------------
ScriptError,Object required: 'WScript'(13,1)
---------------------------------------------
Here is my actual requirement
In a file,
Viewstate="dgfeefc%%$^@!#(!(#!@*#!@)#!@#*@!#)!#!@#@#*((**)()JHJYGV@#@#@#&uc=24"
I have to replace the contents whtever after 'Viewstate=' and before
first '&' with '&strviewstate'. This has to be done in the whole
file(i,e) untill the end of the file.
Thanks again in advance,
Sunil
"ganesh" <sganesh80@gmail.com> wrote in message news:<1095963098.423106.84950@h37g2000oda.googlegroups.com>...
> 1) Assuming the pattern you are looking for is unique in the file, the
> following VBScript should work:
>
> Dim oFso , oTextFile
>
> Set oFso = CreateObject("scripting.filesystemobject")
> 'file name
> strFile = "C:\test.txt"
> 'string to search
> strSearch = "Appointment"
> 'string to insert
> strInsert = "testing only"
>
> FileContents = ""
>
> Set oTextFile = oFso.OpenTextFile (strFile,1)
>
> Do Until oTextFile.AtEndOfStream
> sLine = oTextFile.ReadLine
> FileContents = FileContents & sLine & vbcrlf
> If InStr (1,sLine,strSearch,1) Then
> FileContents = FileContents & strInsert & vbcrlf
> End if
> Loop
>
> Set oTextFile = oFso.OpenTextFile (strFile,2)
> oTextFile.Write FileContents
>
>
> 2) One of the best ways to get around pattern searches is to use the
> Regular Expressions. For details check out:
>
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/reconbuildregularexpression.asp>
>
> In fact you can use Regular Expression in (1) too.
> Hope this helps
> Ganesh
- Next message: Daryl: "Ip address to dword conversion"
- Previous message: Dr John Stockton: "Re: string manipulation experts..."
- In reply to: ganesh: "Re: ACT scripting"
- Next in thread: ganesh: "Re: ACT scripting"
- Reply: ganesh: "Re: ACT scripting"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|