comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » not so IDL related... Command line auto-feed
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
not so IDL related... Command line auto-feed [message #61137] Mon, 07 July 2008 16:00 Go to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Hi all,

sorry for the misuse of this forum... though one of the smart here may
be of great help!

Ok, I have to process about 200 files though a program called dem2xyzn
(for USGS DEM files). This program runs only under windows (and dos),
and have basically no support. You start the program, then it ask for
the name of the input file, then for the name of the output file, then
if you are sure you want to continue etc.

I want to automate all of this...
There seems to be no way of specifying the parameters values (input,
output) when calling the program.

Is there a way to have a text being written in the current dos window?
something that would look like, in pseudo-code:

-call the program
-write input1
-write input2
-write any letter to tell the prog to continue
=start again with another set of input?

I have tried to do a batch file, but the "write input1" get executed
after the program has resumed...

Any help of hints would be greatly appreciated!!!
Jean
Re: not so IDL related... Command line auto-feed [message #61205 is a reply to message #61137] Wed, 09 July 2008 09:38 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Jeff N. wrote:
> On Jul 7, 7:00 pm, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
> wrote:
>> Hi all,
>>
>> sorry for the misuse of this forum... though one of the smart here may
>> be of great help!
>>
>> Ok, I have to process about 200 files though a program called dem2xyzn
>> (for USGS DEM files). This program runs only under windows (and dos),
>> and have basically no support. You start the program, then it ask for
>> the name of the input file, then for the name of the output file, then
>> if you are sure you want to continue etc.
>>
>> I want to automate all of this...
>> There seems to be no way of specifying the parameters values (input,
>> output) when calling the program.
>>
>> Is there a way to have a text being written in the current dos window?
>> something that would look like, in pseudo-code:
>>
>> -call the program
>> -write input1
>> -write input2
>> -write any letter to tell the prog to continue
>> =start again with another set of input?
>>
>> I have tried to do a batch file, but the "write input1" get executed
>> after the program has resumed...
>>
>> Any help of hints would be greatly appreciated!!!
>> Jean
>
> Are you doing everything (including specifying input & output
> parameters) at the command line? If so, you might be able to stick
> the input parameters in a text file (1 param per line) and do the same
> for any output params. Then run a command like this:
>
> program_name <input_params.txt >output_params.txt
>
> This is just redirecting standard input and standard output, but last
> time i checked (admittedly, this has been quite a while) you can still
> do it at the windows command prompt.
>
> Hope it helps,
> Jeff

Thanks, it works perfectly!
Jean
Re: not so IDL related... Command line auto-feed [message #61215 is a reply to message #61137] Tue, 08 July 2008 17:21 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 7, 7:00 pm, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> Hi all,
>
> sorry for the misuse of this forum... though one of the smart here may
> be of great help!
>
> Ok, I have to process about 200 files though a program called dem2xyzn
> (for USGS DEM files). This program runs only under windows (and dos),
> and have basically no support. You start the program, then it ask for
> the name of the input file, then for the name of the output file, then
> if you are sure you want to continue etc.
>
> I want to automate all of this...
> There seems to be no way of specifying the parameters values (input,
> output) when calling the program.
>
> Is there a way to have a text being written in the current dos window?
> something that would look like, in pseudo-code:
>
> -call the program
> -write input1
> -write input2
> -write any letter to tell the prog to continue
> =start again with another set of input?
>
> I have tried to do a batch file, but the "write input1" get executed
> after the program has resumed...
>
> Any help of hints would be greatly appreciated!!!
> Jean

Are you doing everything (including specifying input & output
parameters) at the command line? If so, you might be able to stick
the input parameters in a text file (1 param per line) and do the same
for any output params. Then run a command like this:

program_name <input_params.txt >output_params.txt

This is just redirecting standard input and standard output, but last
time i checked (admittedly, this has been quite a while) you can still
do it at the windows command prompt.

Hope it helps,
Jeff
Re: not so IDL related... Command line auto-feed [message #61218 is a reply to message #61137] Tue, 08 July 2008 14:28 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Jul 7, 7:00 pm, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> Hi all,
>
> sorry for the misuse of this forum... though one of the smart here may
> be of great help!
>
> Ok, I have to process about 200 files though a program called dem2xyzn
> (for USGS DEM files). This program runs only under windows (and dos),
> and have basically no support. You start the program, then it ask for
> the name of the input file, then for the name of the output file, then
> if you are sure you want to continue etc.
>
> I want to automate all of this...
> There seems to be no way of specifying the parameters values (input,
> output) when calling the program.
>
> Is there a way to have a text being written in the current dos window?
> something that would look like, in pseudo-code:
>
> -call the program
> -write input1
> -write input2
> -write any letter to tell the prog to continue
> =start again with another set of input?
>
> I have tried to do a batch file, but the "write input1" get executed
> after the program has resumed...
>
> Any help of hints would be greatly appreciated!!!
> Jean

So is all of this happening at the command prompt? If it is, you
might try making a text file with each line being the input that the
program needs, then call the program with something like this:

program_name <input_params_text_file.txt >output_text_file.txt

This is also specifying a file to capture the output, which you may or
may not need.

What i'm doing here is just redirecting standard input and standard
output. Hope that somehow works....it's been a while since i used
that kind of thing (anyone remember ATREM?)!

Jeff
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Radar Gridding Advice Sought
Next Topic: Re: about READ_ASCII format and PRINT a double array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:25:14 PDT 2025

Total time taken to generate the page: 0.00747 seconds