williamk Posted January 14, 2007 Share Posted January 14, 2007 Hello, Have a script that will run in a loop. Script will have a variable in it called $fname. $fname is the name of the directory that the script will act on for some file conversions. Each time the script loops and starts over the &fname variable will need to change. Is it possible to pull the $fname value from a text file with all the directory names in it? In other words, I would have a text file with the following in it: Dir 123 Dir 478 Dir 467 Dir 2000 The first time the script runs the $fname would be declared as Dir 123, the second time it would pull the value of Dir 478. and so on down the line. Is there a way to do this with a text file or otherwise? Thanks. Link to comment Share on other sites More sharing options...
GaryFrost Posted January 14, 2007 Share Posted January 14, 2007 FileRead or FileReadLine you'll find them in the help SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
gnosis3d Posted January 14, 2007 Share Posted January 14, 2007 IniRead Link to comment Share on other sites More sharing options...
GaryFrost Posted January 14, 2007 Share Posted January 14, 2007 IniReadIf it's an ini file in ini format. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
williamk Posted January 15, 2007 Author Share Posted January 15, 2007 If it's an ini file in ini format.Yep, filereadline did the trick. Script ended up looking something like:$file = FileOpen("test.txt", 0)While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoopThen I just use the $line variable wherever I need it. The script continues to loop until the end of the file is reached. Awesome!!! It works. Thanks. 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