script with modulus
Posted: 03 Aug 2012 03:01
In a file, I have series of values like these:
0,093333333
0,011666667
0,35
0,02
0,186666667
0,021666667
0,14
0,013333333
0,163333333
0,02
0,35
(there are periodical decimals)
These values per second. I need to get full value per x seconds.
I tried to do some script for it:
But it does not seem to work. Do I have the modulus and condition right? If remains is 0, then the number is fully divisible by the x seconds (without remains).
0,093333333
0,011666667
0,35
0,02
0,186666667
0,021666667
0,14
0,013333333
0,163333333
0,02
0,35
(there are periodical decimals)
These values per second. I need to get full value per x seconds.
I tried to do some script for it:
Code: Select all
@echo off
Setlocal EnableDelayedExpansion
for /F "usebackq" %%V in (".\values_per_second.txt") DO (
SET V=%%V
echo !V!
For /L %%T IN (1,1,7200) DO (
SET M=!V!%%T
echo !V!%%T = !M!
if !M! EQU 0 (
pause
break
)
)
)
pause
But it does not seem to work. Do I have the modulus and condition right? If remains is 0, then the number is fully divisible by the x seconds (without remains).