Hello All,
How can I read from standard input and write to standard output. System.Diagnost ics.Process.Sta ndardInput's MSDN reference didn't help as it separately starts the process and then redirects the Standard Input/Output but what If the process is already running and called my Application to feed it some data. Here's an example to make things a bit clear:
I am simply using Unix pipes i.e. cat command in cygwin (A Linux like Environment for windows) that basically just reads standard input and print to standard output. following is the command:
But that doesn't seems to work.
If some one know ruby here as i don't here's what i want to do the same in C#:
And here's some python equivalent code that i want to accomplish in c# or vb.net:
Any solutions?
Thanks in advance.
How can I read from standard input and write to standard output. System.Diagnost ics.Process.Sta ndardInput's MSDN reference didn't help as it separately starts the process and then redirects the Standard Input/Output but what If the process is already running and called my Application to feed it some data. Here's an example to make things a bit clear:
I am simply using Unix pipes i.e. cat command in cygwin (A Linux like Environment for windows) that basically just reads standard input and print to standard output. following is the command:
Code:
% cat input/sample.txt | src/csharp/maptest
If some one know ruby here as i don't here's what i want to do the same in C#:
Code:
!/usr/bin/env ruby STDIN.each_line do |line| some code here end
Code:
!/usr/bin/env python import re import sys for line in sys.stdin: val = line.strip()
Thanks in advance.