rootx Posted June 4, 2014 Share Posted June 4, 2014 I would like to edit a css file, and replace a string in the third line of it. the msgbox working properly!! but he does not write anything... Why? #include <File.au3> #include <MsgBoxConstants.au3> $file = FileOpen("C:UsersrootxDesktopphoto albumcssstyles2.css") $read = FileReadLine($file,3) $replace = StringRegExpReplace($read,"background","xxxxxxxxxxxxxxx") MsgBox("","",$replace) FileWriteLine($file,$replace) FileClose($file) thanks to all Link to comment Share on other sites More sharing options...
JohnOne Posted June 4, 2014 Share Posted June 4, 2014 Trying to write to line 0? Try adding a legitimate line number in FileWriteLine function. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution UEZ Posted June 4, 2014 Solution Share Posted June 4, 2014 (edited) You are using FileOpen as read only (by default). Check out the help file which mode you want to use. Or use _FileWriteToLine #include <File.au3> #include <MsgBoxConstants.au3> $read = FileReadLine("Test.txt",3) $replace = StringRegExpReplace($read,"background","xxxxxxxxxxxxxxx") MsgBox("","",$replace) _FileWriteToLine ("Test.txt", 3, $replace , 1) Br, UEZ Edited June 4, 2014 by UEZ rootx 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
rootx Posted June 4, 2014 Author Share Posted June 4, 2014 thanks UEZ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now