DOS BAT – Read lines from bottom up Tags: Dell DOS character

DOS BAT – Read lines from bottom up

Try this.

[Works on files with less than 100 lines.]

::== r5.bat
@echo off
setLocal EnableDelayedExpansion

call :clear

for /f “tokens=1,* delims=[]" %%a in (‘find /n /v “" ^< myfile’) do (
if %%a LSS 10 (set N=0%%a) else (set N=%%a)
echo !N! %%b >> myfile.num
)
sort /r < myfile.num > myfile.rev
for /f “tokens=1,* delims= " %%a in (myfile.rev) do (
echo %%b | findstr /b /c:"-"
)

:clear
for %%f in (.num .rev .new) do if exist myfile%%f del myfile%%f
::==

 

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 5 + 2 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)