NSearch Posted April 22, 2005 Posted April 22, 2005 Hello Everyone, and thank you very much for all of your help so far. I have a file which containts account number, I would like to loop through the list extracting each one until the end of file. I am just not too familiar with the syntax. Could someone give me an example. File Example: 129818129737 129781437977 083597324977 927729797297 293729774505 978497247799 13z078249724 7z9247296214 Thanks
CyberSlug Posted April 22, 2005 Posted April 22, 2005 Example from help file:http://www.autoitscript.com/autoit3/docs/f...ileReadLine.htm Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
bshoenhair Posted April 22, 2005 Posted April 22, 2005 From the HELP File $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) Wend FileClose($file)
Kerberuz Posted April 22, 2005 Posted April 22, 2005 You can also read into an array, then you can manipulate it how you need using a For loop. #include <file.au3> Dim $aRecords If Not _FileReadToArray("error.log",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] Msgbox(0,'Record:' & $x, $aRecords[$x]) Next Kerby
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