Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Changing content of files

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,39444
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Changing content of files
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Changing content of files - 11/5/2006 12:45:35 AM   
  Sven

 

Posts: 2
Score: 0
Joined: 11/5/2006
Status: offline
Hi!

I have a question to you experts. I need to change the content of a large number of files. We change our internet provider, so we need to change in every html file the grafic location. The html files can be renamed to txt. So i need a little help to do this task automatically. Is there a way to run a script that changes the content (in the way search & replace) all files in an folder?

Would be happy if someone could help.

So long

Sven
 
 
Post #: 1
 
 RE: Changing content of files - 11/5/2006 5:43:54 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Try this on for size:

      


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Sven)
 
 
Post #: 2
 
 RE: Changing content of files - 11/5/2006 7:49:07 PM   
  Sven

 

Posts: 2
Score: 0
Joined: 11/5/2006
Status: offline
Thank you DiGiTAL.SkReAM!

Is there a way to replace text with "? Actual the script show erros, because of the " in the replace text. The script expects specific commands after the ", i think.

So long

Sven

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 3
 
 RE: Changing content of files - 11/5/2006 10:59:04 PM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Post your code


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Sven)
 
 
Post #: 4
 
 RE: Changing content of files - 11/5/2006 11:50:55 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
check out http://www.ericphelps.com/scripting/samples/
the script name is GlobalSearchAndReplace 

(in reply to Sven)
 
 
Post #: 5
 
 RE: Changing content of files - 11/6/2006 1:13:44 AM   
  ehvbs

 

Posts: 2220
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi Sven,

if I understand your question
    Is there a way to replace text with "?
correctly, an answer is:
    sOld = "He said: 'Hello!'"
    sNew = Replace( sOld, "'", """" )
because in a " terminated literal string two double quotes are
the VBScript way to denote a (single) double quote.

(in reply to Sven)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Changing content of files Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts