Jump to content
Sign in to follow this  
Guest Marauder2k

Search & Replace string

Recommended Posts

Guest Marauder2k

I have a standard text file which I'd like to search for a string, replace it, and save the file again.

The main part I'm having trouble with is the filewrite command. How can I get it to actually replace the string instead of just adding the new changed string to the end of the file?

This is what I have so far:

$file = FileOpen("setup1.txt", 1)
$aaa=StringReplace("%programfiles%", "programfiles", @programfilesdir, 0, 0)
FILEWRITE($file, $aaa)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.