tonycst Posted December 8, 2014 Posted December 8, 2014 Can you guys help me ? I have a large text file that has ";string-name" in its lines in multiple places. I need to replace that line with something else in the entire file and write the file.
Geir1983 Posted December 8, 2014 Posted December 8, 2014 $File = FileRead(@ScriptDir & "\filename.txt") StringReplace($File, ";string-name", "replace text")
JohnOne Posted December 8, 2014 Posted December 8, 2014 FileRead StringReplace FileWrite AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
tonycst Posted December 8, 2014 Author Posted December 8, 2014 (edited) Thanks. Love your avatar John. Edited December 8, 2014 by tonycst
JohnOne Posted December 8, 2014 Posted December 8, 2014 Yours is good too, I used to have one just like it. computergroove 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
jguinch Posted December 8, 2014 Posted December 8, 2014 (edited) To replace each entire line : $sContent = FileRead("file.txt") $sSearch = ";string-name" $replaceTxt = "new text " StringRegExpReplace($sContent, "(?:\A|\R)(\N*\Q" & $sSearch & "\N*)", $replaceTxt) Edited December 8, 2014 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
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