Computing.Net > Forums > Programming > Automation of C program

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Automation of C program

Reply to Message Icon

Name: skv
Date: July 1, 2009 at 01:22:17 Pacific
OS: Windows XP
Subcategory: C/C++
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 1, 2009 at 05:50:44 Pacific
Reply:

It depends on how the program asks.


0

Response Number 2
Name: skv
Date: July 1, 2009 at 08:36:01 Pacific
Reply:

(This note is just to clarify my query)
I have the executable say, a.out

If 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


0

Response Number 3
Name: Razor2.3
Date: July 1, 2009 at 08:42:42 Pacific
Reply:

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.


0

Response Number 4
Name: wizard-fred
Date: July 1, 2009 at 16:41:00 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Automation of C program

simulation of wc in a c program www.computing.net/answers/programming/simulation-of-wc-in-a-c-program/13560.html

C+ program?? www.computing.net/answers/programming/c-program/15723.html

Bike Trader C program www.computing.net/answers/programming/bike-trader-c-program/6557.html