需要将Perl转换为C# [英] Need to convert Perl to C#

查看:86
本文介绍了需要将Perl转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





请任何人帮我将Perl代码转换为C#。

我不是来自perl背景。



Hi ,

Please can anyone help me in converting perl code to C#.
I am not from perl background.

#!/usr/bin/perl
 
my $csv   = "$ARGV[0]";
$filename = $csv;
$filename =~ s/.csv//;

open(Data,"$csv");
 
open(testlist, "testlist.txt"); 

while (<testlist>) 
{
push (@testlist,$_);
}

$TotalTest = @testlist;

close (testlist) || die "Couldn't close file properly";

open(summary, ">../$csv"); 
print summary "Test,PassCount,FailCount\n";


foreach $test (@testlist) {
chomp $test;
open(passfailtest,"$csv"); 
$pass_count = 0; 
$fail_count = 0;
	while (<passfailtest>)
	{
		if ($_ =~ /\b$test\b/)	
		{
			#print "$_";
			if ($_ =~ /Pass/)	
			{
				$pass_count ++;
			}

		if ($_ =~ /Fail/)	
			{
				$fail_count ++;
			}
	
		}

	}	
print summary "$test,$pass_count,$fail_count\n";
}





谢谢

sanju



我尝试过:



我正在尝试理解perl脚本中的代码。

但是在将perl代码转换为c#时遇到困难。



Thanks
sanju

What I have tried:

I am trying to understand the code from perl script.
But getting difficulties in converting perl code to c#.

推荐答案

csv = < span class =code-string>
csv = "


ARGV [0];
ARGV[0]";


filename =
filename =


这篇关于需要将Perl转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆