sosimple Posted March 29, 2007 Posted March 29, 2007 Hi. I want to read the last line of a text file . How can I find the number of the last line to do this? I use $lineIwant = FileReadLine($file,$lastline) How can I make $lastline?
_Kurt Posted March 29, 2007 Posted March 29, 2007 (edited) #Include <File.au3> $NumberOfLines = _FileCountLines($file) $ReadLastLine = FileReadLine($file, $NumberOfLines) Kurt EDIT: Forgot the File.au3 include Edited March 29, 2007 by _Kurt Awaiting Diablo III..
Valuater Posted March 29, 2007 Posted March 29, 2007 Hi. I want to read the last line of a text file . How can I find the number of the last line to do this? I use $lineIwant = FileReadLine($file,$lastline) How can I make $lastline? Maybe... ; Read the last line of a text file ; author - SmOke_N $aSplit = StringSplit(StringStripCR(FileRead('FileLocation.Name')), @LF) MsgBox(64, 'Last Line', $aSplit[$aSplit[0]]) There are many helpful additions to your script here Autoit Wrappers ... Just the Best of the Best!!! 8)
sosimple Posted March 29, 2007 Author Posted March 29, 2007 #Include <File.au3> $NumberOfLines = _FileCountLines($file) $ReadLastLine = FileReadLine($file, $NumberOfLines) Kurt EDIT: Forgot the File.au3 include Thanks to all. I was trying about an hour to do this... This works excellent for me. It needs the File.au3 include. Thanks again.
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