Automation of C program

July 1, 2009 at 01:22:17
Specs: Windows XP
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

See More: Automation of C program

Report •

July 1, 2009 at 05:50:44
It depends on how the program asks.

Report •

July 1, 2009 at 08:36:01
(This note is just to clarify my query)
I have the executable say, a.out

If I type in Unix machine,

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


Report •

July 1, 2009 at 08:42:42
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.

Report •

Related Solutions

July 1, 2009 at 16:41:00
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.

Report •

Ask Question