0

There is a list of text files that needs to be processed. Their names are

samples\file_1.txt
...
samples\file_100.txt

A script calls file test.exe with 2 parameters. The first and second parameters represent input and output file names, which change with the increment 1, and the parameter -t is fixed:

test.exe  \input\file_1.txt \output\file_1.txt -t
...
test.exe  \input\file_100.txt \output\file_100.txt -t

How to write a simplified version of the script, processing files one by one, using the for cycle?

I solved this problem using the Python script, but hope, there is a more common way...

1
  • 1
    This sounds an awful lot like homework to me. What have you tried so far? Did you read help for? Commented Aug 12, 2013 at 17:15

1 Answer 1

1
@echo off
cd /d "c:\samples\input"
md "..\output" 2>nul
for %%a in (*.txt) do (
test.exe "%%a" "..\output\%%a" -t
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.