BlackieHamel
Board Regular
- Joined
- May 9, 2014
- Messages
- 93
I have been using a program to make word puzzles, and it runs in a command window. I use a batch file to input sets of 3-letter combinations, using a FOR /F loop, like this:
In this example, I have a file, input.txt, with many rows containing two trigrams. Here's the beginning 7 rows of input.txt
ABS ENT
ACR NOU
ACU AIN
AFT ATH
AIR ACK
AIR DER
AIR KET
The above code does a wonderful job of feeding these rows, one at a time, to puzzlemaker.exe. Here's what my dream enhancement would be. See the "bow" and "ase" in the code above. Suppose I have another file, input2.txt, in which
BOW ASE
is just the first line. If input1.txt has 15 lines and input2.txt has 10 lines, I would like a loop command that tries 15x10 = 150 possible sets of four arguments to follow puzzlemaker in the command.
Can this be done in batch file language?
Thanks.
Blackie
Code:
FOR /F "tokens=1,2" %%A in (input1.txt) DO puzzlemaker bow %%A ase %%B
In this example, I have a file, input.txt, with many rows containing two trigrams. Here's the beginning 7 rows of input.txt
ABS ENT
ACR NOU
ACU AIN
AFT ATH
AIR ACK
AIR DER
AIR KET
The above code does a wonderful job of feeding these rows, one at a time, to puzzlemaker.exe. Here's what my dream enhancement would be. See the "bow" and "ase" in the code above. Suppose I have another file, input2.txt, in which
BOW ASE
is just the first line. If input1.txt has 15 lines and input2.txt has 10 lines, I would like a loop command that tries 15x10 = 150 possible sets of four arguments to follow puzzlemaker in the command.
Can this be done in batch file language?
Thanks.
Blackie