Hi,
I have a FOR loop something like this :
FOR /f %%a in (temp.txt) do set b=%%a
Here, b takes the contents in the file temp.txt. The contents in this file are as follows :
S0000000.LOG
S0000001.LOG
S0000002.LOG
S0000003.LOG
S0000004.LOG
S0000005.LOG
S0000006.LOG
S0000007.LOG
S0000008.LOG
So, b takes all these values. But I want b to take only the number in the filename. So, I modify my FOR loop as follows :
FOR /f %%a in (temp.txt) do set b=%%a set c=%b:~1,7%
but c is taking the value as 0000008 through out the FOR loop, what should I do so as the values 0000001 to 0000008 come in the variable c?