markj Posted March 14, 2006 Posted March 14, 2006 Does any one have a simple script that i can play with that will search and replace text within a file? i.e. a gui opens up - select the file location, text to search for and text to replace with. The best i will ever be is a beginner!!!!
Lord_Doominik Posted March 14, 2006 Posted March 14, 2006 (edited) you can simply write it yourself... read sth. in the help about FileRead() and FileWrite() but if you have few time i can make you an example... EDIT: a little help would be this... just programm a gui for it and the needed controls: $text = "text" $file = FileRead("file.txt") $string = StringInStr($file, $text) If $string = 0 Then MsgBox(0, "String", "The String wasn't found") Else MsgBox(0, "String", "The String was found at Position: " & $string) EndIf Edited March 14, 2006 by Lord_Doominik
Valuater Posted March 14, 2006 Posted March 14, 2006 (edited) 1Welcome to Autoit2after that script above use fileWriteToLine... its herehttp://www.autoitscript.com/forum/index.php?showtopic=21797#and in the Beat per cdkid3Learn alot Quicjly... herehttp://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited March 14, 2006 by Valuater
Lord_Doominik Posted March 14, 2006 Posted March 14, 2006 thanks for the addition @valuater... forgot that he wants to replace a file...
markj Posted March 15, 2006 Author Posted March 15, 2006 Thanks Guys I will have a play - sorry for my lack of any knoweldge - i am a pleb
Moderators SmOke_N Posted March 15, 2006 Moderators Posted March 15, 2006 i am a pleb There's a new one! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
nfwu Posted March 15, 2006 Posted March 15, 2006 btw, interesting member number!!!Group: MembersPosts: 3Joined: Yesterday, 01:48 AMMember No.: 11100#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
Lord_Doominik Posted March 15, 2006 Posted March 15, 2006 xD... ye ^^... and no prob for helping... everyone started as a beginner...
markj Posted March 15, 2006 Author Posted March 15, 2006 thanks for the encouragement. Pleb is a generally english slang term denoting one who is simple And trust me my posts will probably get more simpler with every addition!
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