how to see last lines of file in dos

September 1, 2011 at 01:36:27
Specs: Windows XP
how to display last lines of file in windows using cmd?

See More: how to see last lines of file in dos

Report •

#1
Report •

#2
September 1, 2011 at 01:53:32
There can only be one last line, how many lines do you need to display?


Please come back & tell us if your problem is resolved.


Report •

#3
September 1, 2011 at 01:58:54
I can't install any software, Is there any command to see last 10 lines?

Report •

Related Solutions

#4
September 2, 2011 at 03:59:09
Test this:

@echo off
cls
setlocal 

:: Syntax: %1 = number of lines at end of file to be displayed.
::         %2 = path and input filename.
::         e.g. 10 C:\Input_filename.txt

If {%1} equ {} echo %%1 omitted - restart&&exit /b
If {%2} equ {} echo %%2 omitted - restart&&exit /b

set infile=%2

for /f "tokens=3" %%A in ('find /v /c "@$+=~@" %infile%') do (
    set lines=%%A
    )

set /a count=%lines%-%1
More +%count% %infile%


Please come back & tell us if your problem is resolved.


Report •

Ask Question