dodger42 Posted July 30, 2006 Posted July 30, 2006 I have looked at the read from file functions, but can't seem to find a way to read the last line. Is there a way to do this, even if I have to count the number of lines and then choose via filereadline. Any suggetions?
Moderators SmOke_N Posted July 30, 2006 Moderators Posted July 30, 2006 dodger42 said: I have looked at the read from file functions, but can't seem to find a way to read the last line.Is there a way to do this, even if I have to count the number of lines and then choose via filereadline.Any suggetions?Look at _FileCountLines() in the Beta help file then use the number it returns with FileReadLine(), should only be 2 lines of code. 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.
dodger42 Posted July 30, 2006 Author Posted July 30, 2006 SmOke_N said: Look at _FileCountLines() in the Beta help file then use the number it returns with FileReadLine(), should only be 2 lines of code.Perfect, thanks Smoke.
flyingboz Posted July 30, 2006 Posted July 30, 2006 dodger42 said: Perfect, thanks Smoke.If you are working with very large files , you may wish to write a wrapper for the command line tail utility. head and tail are designed to swiftly get you the leading or trailing lines in a file; many ports from their unix roots are available. Of course, you would have the overhead of firing up the console session, and handling the resulting output. _FileCountLines depends on a FileRead() operation that can bog down on large files. I've never used the StringAddCR() function, so I don't know how efficient it is. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
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