RT
使用php简单实现
<?php
$file1_name = "./file1";
$file2_name = "./file2";
$file1 = file_get_contents($file1_name);
$file2 = file_get_contents($file2_name);
$arr1 = preg_split("/\n/",$file1);
$arr2 = preg_split("/\n/",$file2);
$count = 0;
foreach($arr1 as $index => $v)
{
if($v != $arr2[$index])
{
$count++;
echo $file1_name."\n";
echo $v."\n";
echo "\n";
echo $file2_name."\n";
echo $arr2[$index]."\n";
echo "\n\n\n";
}
}
echo "不同行数:".$count."\n";
file1
<a href='http://blog.csdn.net/qq_22253823/article/details/53607574' target=_blank>
获取中文字符串中的数字并转换成阿拉伯数字
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/53583884' target=_blank>
linux rar和zip工具
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/53574280' target=_blank>
curl函数和curl_errno错误码说明
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/49685849' target=_blank>
将一个List(Object)中的Object根据相同属性名的值整合到一个两层List(List( Object))
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/46627765' target=_blank>
PHP整合Jcrop截取的上传头像功能
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/46011949' target=_blank>
关于一分钟管理法
</a>
file2
<a href='http://blog.csdn.net/qq_22253823/article/details/53607574' target=_blank>
获取中文字符串中的数字并转换成阿拉伯数字 - InE
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/53583884' target=_blank>
linux rar和zip工具 - InE
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/53574280' target=_blank>
curl函数和curl_errno错误码说明 - InE
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/49685849' target=_blank>
将一个List(Object)中的Object根据相同属性名的值整合到一个两层List(List( Object)) - InE
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/46627765' target=_blank>
PHP整合Jcrop截取的上传头像功能 - InE
</a>
<a href='http://blog.csdn.net/qq_22253823/article/details/46011949' target=_blank>
关于一分钟管理法 - InE
</a>
结果
./file1
获取中文字符串中的数字并转换成阿拉伯数字
./file2
获取中文字符串中的数字并转换成阿拉伯数字 - InE
./file1
linux rar和zip工具
./file2
linux rar和zip工具 - InE
./file1
curl函数和curl_errno错误码说明
./file2
curl函数和curl_errno错误码说明 - InE
./file1
将一个List(Object)中的Object根据相同属性名的值整合到一个两层List(List( Object))
./file2
将一个List(Object)中的Object根据相同属性名的值整合到一个两层List(List( Object)) - InE
./file1
PHP整合Jcrop截取的上传头像功能
./file2
PHP整合Jcrop截取的上传头像功能 - InE
./file1
关于一分钟管理法
./file2
关于一分钟管理法 - InE
不同行数:6
[Finished in 0.1s]