How To Run PERL Scripts In C#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi<br/> <br/> I am currently writing an application in C# and I need it to call a PERL script to do some text processing. I have searched on a number of different forums and found some code which people have said should work but when I use it, the file is not processed.<br/> <br/> The code I have is:<br/> <br/> ProcessStartInfo perlStartInfo = new ProcessStartInfo("perl.exe");<br/> perlStartInfo.Arguments = "Word_Splitter.pl " + inputFilePath + " > " + outputFilePath;<br/> perlStartInfo.UseShellExecute = false;<br/> perlStartInfo.RedirectStandardOutput = true;<br/> perlStartInfo.RedirectStandardError = true;<br/> perlStartInfo.CreateNoWindow = true;<br/> <br/> Process perl = new Process();<br/> perl.StartInfo = perlStartInfo;<br/> perl.Start();<br/> string output = perl.StandardOutput.ReadToEnd();<br/> perl.WaitForExit();<br/> <br/> I have tried playing around with the different settings in an attempt to get it to work but so far I have had no luck. I would appreciate any help anyone could give me on this.<br/> <br/> The PERL script that I am attempting to run can be found here:<span style="font-size:11pt <span><br/> <span style="font-size:11pt;font-family:Arial;color:black http://l2r.cs.uiuc.edu/~cogcomp/atool.php?tkey=WS http://l2r.cs.uiuc.edu/~cogcomp/atool.php?tkey=WS <span style="font-size:11pt;font-family:Arial;color:black <br/> <br/> Thanks in advance<br/>

View the full article
 


Write your reply...
Back
Top