Here's an example.
I created two TXT files which represent your error files:This is text.txt
SELECT *
FROM zahtjevi
WHERE datum_unosa BETWEEN SYSDATE - 3 / 24 AND SYSDATE; -- the last line in test.txt
This is test1.txt
SELECT SYSDATE,
cnt cnt_zahtjeva,
ROUND (cnt / (SYSDATE - min_datum_unosa), 1) avg_dnevno
FROM test; -- the last line in test1.txt
This is a batch script which displays the last line in all TXT files in current directory ("all" files are these two files I created: TEST.TXT and TEST1.TXT):
@echo off
set LASTLINE=
setlocal enabledelayedexpansion
for %%a in (*.txt) do (
echo %%a
for /f "delims=" %%s in (%%a) do set LASTLINE=%%s
call echo !LASTLINE!
)
Finally, execution:M:\>last_line
test.txt
WHERE datum_unosa BETWEEN SYSDATE - 3 / 24 AND SYSDATE; -- the last line in test.txt
test1.txt
FROM test; -- the last line in test1.txt
M:\>