Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I have C program, and when execute it, it ask for input filename and output file name. (The program does some calculation from input file supplied and write out the out put text file with the name input to the keyboard). I have to do this operation for many input files to write ut that much ouput files. My query is that, is there a way to automate this, so that if I give all the input & output file names, say, in a text file? . i.e the C program shouldexecute each time and read input and output filename one by one.If any one has any suggestion please share.
Thanks in advance

(This note is just to clarify my query)
I have the executable say, a.outIf I type in Unix machine,
./a.out
Input file name? ( here I manually input the name of the file, say f_in.txt)
Output file name? (here also I manually input the name of the file, say f_out.txt)(This is what I want to do, but I have many input files to process and I want to some how automate the execution of above C program. (like, provide all the input and output file name to be keyed in thru a text file or some thing like that..)
Appreciate if any one can thow some light on this
Thanks

It would also depend on your platform. You specified Windows XP in the original post, but now you're talking about UNIX.
If it's WinXP, it's possible but a pain to do.
If it's UNIX, I think awk has the functionality to read both files at once.

It depends on how the program is written. How it handles input. I use to write programs similar to your requirements. Input parameters or batch input from data file. Output individual reports and also include summary sheet for batch.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |