I'm trying to read text lines from a file, and increment a counter so I can eventually simulate an array in DOS.
I'd like to be able to store the lines of text in a DOS array for further processing.
My current attempt is:
set TEXT_T="myfile.txt"
set /a c=1
FOR /F "tokens=1 usebackq" %%i in (%TEXT_T%) do (
set /a c=c+1
echo %%i, %c%
)
But the variable c is not incrementing; it stays at 1.
Suggestions welcome.
Thanks, Mike
See Question&Answers more detail:os