这个通过编程你应该可以实现吧,有困难的话我可以用vb给你编一个,
/*程序如下,在运行时请把腊判程序中的两个要比较文件名改为你实际要告友比较的文件*/
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
const char * const filename1="E:\\database\\text1.txt"
const char * const filename2="E:\\database\\text2.txt"
compareFile(filename1,filename2)
getch()
return 0
}
int compareFile(const char * const filename1,const char * const filename2)
{
FILE *infile1 , *infile2
int lineIndex, ch1,ch2
infile1=fopen(filename1,"r")
infile2=fopen(filename2,"r")
if(!infile1 || !infile2)
{
printf("function copareFile error:Open file error:")
getch()
exit(0)
}
lineIndex=1
while((ch1=fgetc(infile1))==(ch2=fgetc(infile2)) &&ch1!=EOF &&ch2 !=EOF)
{
if(ch1=='\n')
lineIndex++
}
fclose(infile1)
fclose(infile2)
if(ch1!=ch2)
printf("The Two Files is defferent at line %d :'%c' and '%c'",lineIndex,ch1,ch2)
else
printf("The Two Files are identical!\轮友改n")
}
有,用vim(大蛇推荐Gvim)有diffthis命令可以比较两个文件,这是一种办法。还有就是使用轿隐subversion来存放代码,tortoisesvn有代码比较功能,这带帆知是其二,还有其他办法,但是这是我最常用的2个方法。蠢消大蛇原创,BS抄袭的。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)