iceberg Posted April 25, 2006 Posted April 25, 2006 (edited) Hi, I know it is possible to replace a line in a text file. But how do I perform the following: 1) Hundreds of text files in a folder 2) Need a script to "open" up each of them so that the first line all those files can be modified. Please help. Thanks. Edited April 25, 2006 by iceberg mouse not found....scroll any mouse to continue.
Moderators SmOke_N Posted April 25, 2006 Moderators Posted April 25, 2006 Hi,I know it is possible to replace a line in a text file. But how do I perform the following:1) Hundreds of text files in a folder2) Need a script to "open" up each of them so that the first line all those files can be modified.Please help. Thanks.Look at FileFindFirstFile() and FileFindNextFile() in the Beta help file, then store them into an array, and perform what you want in order with a loop on each file with whatever method your using to replace the first line. Maybe even _FileWriteToLine() would help. 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.
iceberg Posted July 18, 2006 Author Posted July 18, 2006 thnaks for the reply SmOke_N. i m very weak in arrays. can someone be kind enuf to guide and start me off....? mouse not found....scroll any mouse to continue.
Briegel Posted July 18, 2006 Posted July 18, 2006 (edited) With this little script you can see a list of your files. #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray('C:\Program Files', '*.*', 0) ;set your folder _ArrayDisplay($FileList,'$FileList')oÝ÷ ØZ+Ê«)Êj{¬{tß¡bââ²Ý7õ«¢+Ù5Í ½à À°Ìäí9յȽ¥±ÌÌäì°ÀÌØí¥±1¥ÍÑlÁt¤íÑÉäÀÌØí¥±1¥ÍÑlÅt°ÀÌØí¥±1¥ÍÑlÉtѸ Look at helpfile (BETA I think) and you're surely be able to write this script on your own. EDIT: added comments Edited July 18, 2006 by Briegel
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