On 02.05.2010 21:55, galen kaufman wrote:>
> Dear R Community,
>
> I am trying to run a command line in R that will open an external program,
have it import a specific input file, run the program, then close the program.
The command line that I got from the developer of the model to do this looks
like what you see below:
>
> c:\programx.exe -import 'inputx.inp' -run -quit
>
> I have been trying to use shell() or shell.exec() to run this in R. I can
get R to open the program but I have not been able to do the rest of the steps.
>
> I have been able to open the model using :
>
>> shell('"C:\\programx.exe"')
>
> or
>
>> shell.exec("C:\\programx.exe")
>
> To do the rest I have been trying variations of the following:
>
>> shell('"C:\\programx.exe"' -import
'"C:\\inputx.inp"' -run ?quit)
Hm, you need to pass one string to the shell (and the underlking
system()) call:
shell('"C:\\programx.exe" -import "C:\\inputx.inp" -run
?quit')
Best,
Uwe Ligges
> but I am not getting anywhere.
>
> Can you provide any insight as to how to do the rest?
>
> Thank you,
>
> Galen
> _________________________________________________________________
> Hotmail is redefining busy with tools for the New Busy. Get more from your
inbox.
>
> N:WL:en-US:WM_HMP:042010_2
> [[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.