Results 1 to 2 of 2

Thread: Replace Text

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    18

    Replace Text

    Hi there,

    Can anyone explain how to run a replace text string and amend a file in vbscript.

    Example replace all "test" in txt file log.txt

  2. #2
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Replace Text

    hi

    Scripting.FileSystemObject has the full role in this process. this link will provide you details abt the object.

    you have to read each line of the source file. replace the "test" in every line using replace() in vbscript. and write it to another file, say a temp file. after full copy close the source and temp files. then delete the original file and rename the temp file to the original filename.
    --Kishore...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width