i try to add two numbers received from a file.
But it shows only the last value of sum. Thx for the help!
@FOR /F "eol=; tokens=1-3 delims=, " %%i IN (test.txt) DO (
set m=%%j
set n=%%k
set /a sum=%m%+%n%
echo sum = %sum%
)
and in the test.txt i have
alex 4 5
john 6 7
and i want to see
sum=9
sum=13
it only shows
sum=13
sum=13
sum =. It's not exactl y the last value your loop shows but instead the one from before the loop.