views:

85

answers:

2

Dear Experts,

I'm writing a script that should process a contents of a file, but should be file-independent. The second step would be using the script few times in pipe as follows:

type input.txt|script.bat ...|script.bat ...|script.bat ... > output.txt

Is it possible to use either of the following syntax:

type input.txt|script.bat

or

script1.bat ...| script1.bat ...

If the answer is positive, please help me to understand this technique.

A: 

As far as I know, it is possible. At least from the Windows XP (and upwards) shell.

Alan Haggai Alavi
Dear Alan,Could you provide any example please?
Andrey
Hi Audrey. Sorry for replying late. I should admit that I _have not done_, and _do not know how to do_ it in Windows' command line. By the way, happy Christmas! :-)
Alan Haggai Alavi
If you find the answer, please add an answer here so that possible future queries can be directed here.
Alan Haggai Alavi
A: 

Dear Alan,

How to access the piped data from the second bat file?

Andrey
Please edit your question instead of adding an answer. And, what do you mean, how to access the piped data? It's just standard output, piped to standard input.
John Saunders
For instance, I have test.bat and typedir|test.batHow can I access to the dir output inside test.bat?
Andrey
How can I access to standart input from a batch script?
Andrey