friends Posted October 3, 2004 Posted October 3, 2004 Well, I wonder how to read such file with AutoIT3 ?Below show example is only 1 record.10067465 MIS Department 9005S40011 as the record keep appending one after another, how can I performa FileRead() to actually get the data I wanted ?The above example, the data I need is 7465 (after 1006), 9005 (before S) and 1 (after 4001) which is a check digit.Kindly see the attached file, it looks "complex" to me ! Hope you can help me up with this by providing a working file.Big thanks...cashier.txt
Def Posted October 4, 2004 Posted October 4, 2004 (edited) Try the StringTrimLeft() function. "Returns the string trimmed by count characters from the left" so: $file = FileOpen("cashier.txt", 0) While 1 $result = FileReadLine($file) If @error = -1 Then ExitLoop $splitResult = StringSplit($result, " ") ;should be able to combine this and the FileReadLine line above $trimmedResult = StringTrimLeft($splitResult[1], 4) ;chop off first 4 chars WEnd Haven't tested this at all. Def Edited October 4, 2004 by Def
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