|Batch is probably not the best language when it comes to math, as division of numbers often result in floating point values (numbers with decimals). There are workarounds of course.|
By "Just replace the number", do you mean modify the numbers.txt file, or do you mean keeping the "loan" and "debt" text?
This adds two decimals and keeps the text before the number:
:: Just to make sure we're in the same directory as the script.
echo WScript.Echo Eval^(WScript.Arguments^(0^)^)>eval.vbs
for /f "tokens=*" %%A in (numbers.txt) do (
for /f "tokens=*" %%B in ('echo %%A ^| find "$"') do (
for /f "tokens=1,2 delims=$" %%Y in ("!line!") do (
for /f %%N in ('cscript //nologo eval.vbs "!num!/500"') do (
for /f "tokens=1,2 delims=." %%C in ("!result!") do (
if not "%%D"=="" (
) else (
for /f "tokens=*" %%B in ('echo %%A ^|find /v "$"') do (
pause > nul
Marking answers that solve, or help helps you solve a problem as "Best Answer" also helps other people solve similiar ones in the future.
message edited by RainBawZ