I’m trying to get the last line of an variably named log file. I can get the file, list the contents, and get the number of lines. When I try and combine it, I get an error
Each piece of info is available:
(name of it, number of lines of it, lines of it) of (files whose (name of it contains "savingthrow-") of folder "C:\test\")
results in:
savingthrow-20150514.log, 4, this is line 1
savingthrow-20150514.log, 4, this is line 2
savingthrow-20150514.log, 4, this is line 3
savingthrow-20150514.log, 4, No adware found
savingthrow-20150515.log, 5, this is line 1
savingthrow-20150515.log, 5, this is line 2
savingthrow-20150515.log, 5, this is line 3
savingthrow-20150515.log, 5, this is line 4
savingthrow-20150515.log, 5, Genio adware found
Get a specific line works as well:
(name of it, line 4 of it) of (files whose (name of it contains "savingthrow-") of folder "C:\test\")
results in:
savingthrow-20150514.log, No adware found
savingthrow-20150515.log, this is line 4
Get last line of unknown file does not work:
(name of it, line (number of lines of it)) of (files whose (name of it contains "savingthrow-") of folder "C:\test\")
Result:
Property 'line <integer>' is not defined
But if I name the file specifically I can get last line of file:
line (number of lines of it) of file ("C:\test\savingthrow-20150514.log")
Results:
No adware found
What I ultimately want to see is:
savingthrow-20150514.log, No adware found
savingthrow-20150515.log, Genio adware found
Any ideas?