I'm really new to batch scripting, so please be patient!
In windows xp I have an executable which has input.in and output.out files.
I would like to create a batch which reads the input file, modifies one or more lines, runs the .exe and stores the output in a folder whose name is dependent on the change made to the input file.
Say I have an input file with 4 lines like this:
32.0d0 ! first parameter
54.0d5 ! second parameter
1.5d-1 ! third parameter
11.0d0 ! fourth parameter
and I want to change the second parameter in the range 0.0->1.0 with step 0.1:
@echo off
setlocal EnableDelayedExpansion
set ReplaceLine1=2
set inpfile=input.in
set tempfile=input.temp
set increment=0.1
if exist "%tempfile%" del "%TempFile%"
for /L %%i in (1,1,11) do (
set /A param_value=(%%i-1)*increment
set /A Cnt2=0
for /f %%a in (%inpfile%) do (
set /A Cnt2+=1
if !Cnt2! geq %ReplaceLine1% echo %param_value% >> "%tempfile%" else echo %%a >> "%tempfile%"
)
copy /y "%tempfile%" "%inpfile%"
MD .\"param_value"
executable.exe < "%tempfile%" >> .\"param_value"
)
does the above have any chance to get me somwhere close to where I would linke to go?