phatzilla Posted May 10, 2010 Share Posted May 10, 2010 Hey guys, so currently my script reads values from an INI file I.E Input1=aaaaaaaaaaa Input2=bbbbbbbbbbbb Input3=ccccccccccccc Input4=ddddddddddddd Input5=eeeeeeeeeeee . . . . Each time my loop continues, it goes to the next "input" line in the Ini file. This is really inefficient because i have to constantly change the input values. It would be immensely easier for me to just copy paste my input values in a Txt file, and have the script read each line as a separate input, and when the loop continues, it goes to the next line. I.E aaaaaaaaaaaa bbbbbbbbbbbb cccccccccccc dddddddddddd eeeeeeeeeeee How is this done? And another question would be (provided my first question is accomplished), can i make the script 'ignore' the first x characters in each line? Say line 1 "aaaaaaaaa" I want it to ignore the first 3 characters, and only take the rest. Thanks guys. Link to comment Share on other sites More sharing options...
hawky358 Posted May 10, 2010 Share Posted May 10, 2010 (edited) You do it line by line like so: Just go check filereadline() and stringtrimleft() (And the general string processing) in help Do $line = FileReadLine($file) ;read from ini $line = stringtrimleft($line.......) ; trim characters from the left filewriteline($txt,$line) ;write to text Until @error = -1 You can do it with fileread then, stringregexp, but this way is simpler if you don't know how Edited May 10, 2010 by hawky358 Link to comment Share on other sites More sharing options...
JohnOne Posted May 10, 2010 Share Posted May 10, 2010 Either way you are still reading them one by one from a file of some sort. Why not just use inireadsection and loop through the resulting array ? 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