Link to home
Create AccountLog in
Avatar of michael4606
michael4606

asked on

Get the Last Line of a Text File

Hello,

In standard batch file how can I get the last line of a text file?

Like the UNIX\GNU Win32 tail -f.  Note I cannot use any tools such as tail.

Thanks,

Michael4606
Avatar of knightEknight
knightEknight
Flag of United States of America image

for /f "delims=" %L in (MyFile.txt) do  set line=%L
@echo %line%
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of michael4606
michael4606

ASKER

Thanks for posting - that did the trick.