Batch file to edit a txt file that is part of a compiled exe file using for /f

Home Forums Scripting DOS Command Shell Batch file to edit a txt file that is part of a compiled exe file using for /f

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    Sargeo80
    Member
    #149657

    i have a compiled executable that runs a certain input file, and provides a certain output file.

    I need to conduct analysis of multiple inputs and versus multiple outputs

    i will need to run the exe about 100 times but the only difference in each input is a single number

    i just started writing batch files, and i have figured out a way to run the executable, and change the variable in the input

    i am having trouble making the batch file continuously run the program while changing the input variable by adding 1 from 24 to 25.

    Below is a test series that i have been using to learn, i have been doing this for weeks, and unfortunately no one around here has a clue about what i am talking about. this is really important. Can you help me?

    Code:
    : BEGIN
    :: (THIS IS THE EXECUTABLE)
    ..executabl.exe
    :: (THIS IS WHERE THE OUTPUT FILE IS BEING SAVED)

    @ECHO
    OFF
    COPY out.TXT out1.TXT
    :: (THIS IS where THE VARIABLE IN THE input FILE IS BEING CHANGED FROM 24 TO 25)
    SETLOCAL ENABLEDELAYEDEXPANSION
    FOR /F “tokens=*delims=” %%a in (inp.txt) do (set str=%%a
    set str=!str:24=25!
    ECHO !str!>> inp.TXT
    :: (THIS IS WHERE I GET STUCK, I NEED TO PROGRAM TO RUN WITH VALUES OF !str! from 24 to 100)
    IF !str!==100 GOTO END
    IF NOT GOTO BEGIN)
    : END
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.