#1
|
|||
|
|||
AHK FileReadLine
How can I use FileReadLine to read the last line in a text file?
|
#2
|
|||
|
|||
Re: AHK FileReadLine
Assuming you do not know in advance how many lines the file contains, not by using FileReadLine [img]/images/graemlins/smile.gif[/img]
At a quick glance, the AHK documentation suggest this snippet: <font class="small">Code:</font><hr /><pre> <font color="green">; Example #2: Retrieve the last line from a text file.</font> Loop, read, C:\Log File.txt last_line := A_LoopReadLine <font color="green">; When loop finishes, this will hold the last line.</font> </pre><hr /> http://www.autohotkey.com/docs/comma...opReadFile.htm How efficient this is I do not know, maybe not very for large files, in which case reading the whole thing then StringTrimLeft to chop it to the last line may be better, although I really have no idea [img]/images/graemlins/smile.gif[/img] Good luck, dave. |
#3
|
|||
|
|||
Re: AHK FileReadLine
Thanks Dave. All is running smoothly now.
|
|
|