can anyone pls tell me how can i read the contents of a file in reverse order....ie i'm storing the num from 1 to 100 in a file but i wen i read thre content it shouls start from 100 99 to 1..i tried to sort /r but it does not work for 0 to 9....pls help

@echo off
echo Enter File Name
:input
set TAB=		 
set INPUT=
set /P INPUT=Type input: %=%
if "%INPUT%"=="" goto input
echo Your input was: %INPUT%

FOR /L %%i IN (11 1 99) DO echo  	%%i >> %INPUT% 
FOR /F "delims=TAB" %%i IN (%INPUT%) DO echo %%i >> %INPUT%  
sort /R %INPUT% >>result.txt

Recommended Answers

All 2 Replies

<deleted>

example
file name=a.txt
tac a.txt(it will print reverse order tac is command reverse of cat)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.