I'm trying to write a command for DOS command prompt that will call an executable and save the results to a text file. So I want to achieve this:
myExec dataFile.1 > dataOut1.txt
myExec dataFile.2 > dataOut2.txt
... (each of these individually already works fine)
I tried writing a for loop like this:
for %A in (1 2 3) do myExec dataFile.%A > dataOut%A.txt
The problem is that the ">" output to file thing gets interpreted as applying to the for loop, not to each command - so the end result is that myExec gets called but doesn't save the .txt file, except for the last one which saves to a file literally called "dataOut%A.txt".
I tried putting the whole "myExec... > ..." part in quotes which let to it knowing the correct commands but not executing them (not explaining that well, but anyway it didn't work).
Thanks so much for any help!!