문서 보기역링크PDF로 내보내기맨 위로 이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요. ```perl #!/usr/bin/perl # fileName, Tag, Value sub checkFile{ my $fileName = shift; my $tag = shift; my $value = shift; my $endTag = $tag; substr($endTag,1,0,"/"); my $found = ""; my $re = $tag . "(?:.+?_)?(\\d+?)(?:_.+?)?" . $endTag; open FILE, $fileName or die $!; while (my $line = <FILE>){ #print "RE: " . $re . "\n"; $match = $line=~/${re}/; if($match){ #print $line . $1; if ($1 != $value){ print "Different:" . $1 . " != " . $value . "\n"; }else{ $found = true; } } } close FILE; if (!$found){ print "[ERR] :" . $fileName . "에서 ". $re . " 값을 찾지 못했습니다. \n"; }else { print $fileName . " 확인 완료 \n"; } } $stdFile = "C:\\yourfile.xml"; #print $ncaFile; $stdValue = ""; open STD_FILE, $stdFile or die $!; while (my $line = <STD_FILE>){ $match = $line=~/<server>(.+?)<\/server>/; if($match){ $stdValue = $1; last; } } close STD_FILE; if (!$stdValue) { print "파일에서 기준값을 찾지 못했습니다"; die; } print "STD: " . $stdValue . "\n"; $file = "C:\\yourSearchFile.xml"; $tag = "<name>"; checkFile($file, $tag, $stdValue); ``` open/checkfile.txt 마지막으로 수정됨: 2020/06/02 09:25저자 127.0.0.1