Fortran Fortran; Calling an executable that in turn runs an input file

AI Thread Summary
To automate the execution of "runner.exe" with multiple input files, a Fortran program can be created to generate a series of text files named in001.txt to in100.txt, each containing the name of the corresponding input file. The program should also create a batch file that sequentially runs "runner.exe" with each input file. The batch file will include commands to redirect the input from each text file to "runner.exe". If the goal is to consolidate outputs, the batch file can be modified to append the results to a single output file, ensuring that all outputs are captured in one document. This approach eliminates the need for manual input and streamlines the process of running "runner.exe" with multiple inputs.
Aeroengie
Messages
2
Reaction score
0
Hi. I need to write a fortran program that calls an EXE, call it "runner.exe" that in turn runs an input file, call it "run.inp". Thing is, I would normally run "runner.exe" manually, and type in "run.inp" and "runner.exe" gives outputs. But now, I have 100's of input files and I can't affod to do it manually anymore so I need to automate the process, that is, have a program that calls "runner.exe" and "runner.exe" calls all the 100's of input files. How do I do that ?
I have tried [ Call system ('runner.exe') ] and all that does is actually run "runner.exe" but remember, "runner.exe" is in turn waiting for me to type in an input file. So how do I automate the process ?
Note: "runner.exe" was written by someone else and let's assume I don't have the code.
Many thanks.
 
Technology news on Phys.org
Create a program to create a set of files named in001.txt, in002.txt, ... in100.txt. In each text file, include the name of the file you want to use for input. Then the program should write a batch file, with the following lines:

runner <in001.txt
runner <in002.txt
...
runner <in100.txt

I'm not sure what you're doing with the output, but if you want it all in a single file:

delete out.txt
runner <in001.txt >>out.txt
runner <in002.txt >>out.txt
...
runner <in100.txt >>out.txt
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
25
Views
3K
Replies
12
Views
3K
Replies
5
Views
5K
Replies
17
Views
6K
Replies
3
Views
2K
Replies
5
Views
2K
Replies
33
Views
2K
Back
Top