Solved Adding numbers in every line in .bat

January 29, 2015 at 07:40:22
Specs: Windows 7
how can i edit a text file putting numbers in every line in bat file..
say i have text1.txt
A;a
B;b
C;c
D;d
and i want to put a number in each every line that looks like this
1. A;a
2. B;b
3. C;c
4. D;d

thanks..
help will be very much appreciated..


See More: Adding numbers in every line in .bat

Report •

#1
January 29, 2015 at 10:01:38
✔ Best Answer
@echo off & setlocal EnableDelayedExpansion
set cnt=0
for /F "tokens=* delims=" %%j  in (imput.txt) do (
  set /A cnt+=1
  echo.!cnt!. %%j
) >> output.txt


Report •
Related Solutions


Ask Question