471,092 Members | 1,100 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Question about C programming

6
I have a question. I made a C program that copies a CSV file into another CSV file but with a new column. To run it you have to put this ./programname inputfile outputfile

I need to use the inputfile name in the program, is there a way that the program can save the inputfile name as a string from the command line at theterminal???

Im using the comand:

>foreach $var (`cat list.txt`)
>./programname $var.csv new$var.csv
>end

On the list.txt there are all the file names i want to work on.

Is there a way for it to take the inputfile name as a string without the .csv extension, like just the $var part?
Jul 10 '06 #1
0 2245

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by max | last post: by
12 posts views Thread by pachanga | last post: by
7 posts views Thread by Tony Johansson | last post: by
17 posts views Thread by Materialised | last post: by
1 post views Thread by Katrin Tomanek | last post: by
5 posts views Thread by Rasmus Kromann-Larsen | last post: by
13 posts views Thread by John Salerno | last post: by
13 posts views Thread by Woody Splawn | last post: by
8 posts views Thread by Support | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.