What's the easiest way to read the last line of a text log file please?
Is there some combo of ReadFile, Separate and ReadLn I can use? Thanks.
Reading Last Line of Log
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
ReadFile>c:\bla\logfile.log,FullFile
Separate>FullFile,CRLF,Lines
Let>last=Lines_%Lines_Count%
MessageModal>last
Separate>FullFile,CRLF,Lines
Let>last=Lines_%Lines_Count%
MessageModal>last
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Does this help?
From one of my earlier postings in July 2006
Edited: Hmm too slow today. There was no reply when I started this. Marcus' solution is much better.
From one of my earlier postings in July 2006
==================The old DOS "FIND" command may work for you.
Try this from a command line:
FIND "qqq" c:\path\file.txt /v /c
You will get two lines back with a count of all the lines that do not contain "qqq" on the second line.
If that works for you then you can run that with Run Program command:
Run Program>command.com /c FIND "qqq" C:\path\file.txt /v /c > c:\path\lines.txt
ReadLn>c:\path\lines.txt,2,result
MessageModal>Line count = %result%
//You can use other lines to strip out everything to the left of the colon in %result%
Edited: Hmm too slow today. There was no reply when I started this. Marcus' solution is much better.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!