JohnOne Posted August 24, 2009 Share Posted August 24, 2009 (edited) Ive been looking into the possibility of editing multiple .txt files Been looking at FileRead and FileWrite but FileWrite/FileWriteline only says it will add text to a line in a file, or write to the end of a file. What I want to do is delete all the text from multiple files in a directory and replace it with different text The file names are different, but the new text in them would be the same in all files, and need to be saved with its original filename. Is there a command in autoit that would help me achieve this ? Appreciate any pointers. Edited August 24, 2009 by JohnOne 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...
JohnOne Posted August 24, 2009 Author Share Posted August 24, 2009 I almost found something "_ReplaceStringInFile" but alas that wants the full path (not a problem) and filename (theres a problem, they are all different) and the string to replace (another problem, all strings are different) I'm thinking that there is probably a way to set the filenames and srings as variables in order to use this function though. Any tips how ? 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...
JohnOne Posted August 24, 2009 Author Share Posted August 24, 2009 (edited) I'm nearly there with this I'm just trying to automate the process by sending a series of keysrokes and such I'm a little stuck though, I cannot find how to enter the + key into the script, to achieve the ctrl+a to select all. If anyone tell me how to do that, I would appreciate it EDIT: its okay, I found ^a to do it. Edited August 24, 2009 by JohnOne 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...
JohnOne Posted August 24, 2009 Author Share Posted August 24, 2009 Im seriously stuck now if anyone can help me I've written some clumsy script to do it for me, except I dont know how to get it to loop and continue the process of moving down the files repeating it. Run("C:\WINDOWS\EXPLORER.EXE /n,/e," & $Path) WinWaitActive("2", "", 1) Send("{TAB}") For $1 = 0 To 200 Next Send("{DOWN}") Sleep(100) Send("{ENTER}") Sleep(500) Send("^a") Send("text") Sleep(200) Send("^s") Send("!{F4}") 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...
JohnOne Posted August 25, 2009 Author Share Posted August 25, 2009 case closed I had next in the wrong place where it should have been at the bottom, Totall NOOB. It took quite some time completing the task this way with over a thousand files, so I'm still interested if anyone can offer a better faster solution. Thanks John. 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...
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