我刚收到compare word in command line solution。 并尝试通过TortoiseSVN diff scripts(diff-doc.js)比较两个word文件,但我发现它显示了很多关于字体或段落设置的差异。
是否有任何代码示例有关如何修改diff-doc.js以忽略字体更改并忽略段落格式更改?我只想在第一时间关注文本内容。
答案 0 :(得分:0)
我不是100%肯定你在问什么,但你可以在vbscript中做这样的事情:
strPath1 = [the location of the first file]
strPath2 = [the location of the second file]
strLog = [the location of a log file]
set ofs = CreateObject("Scripting.FileSystemObject")
'create a log file
If Not oFs.FileExists(strLog) Then
set logFile = oFs.CreateTextFile(strLog, true)
else
set logFile = oFs.openTextFile (strLog, 8, True)
End if
set file1 = ofs.openTextFile (strPath1)
strFile1Buffer = file1.readAll
file1.close
set file2 = ofs.openTextFile (strPath2)
do while not file2.atEndOfStream
strLine = file2.readLine
If InStr(strFile1Buffer, strLine) = 0 Then
strLogEntry = strLogEntry & strLine & vbCrLf
End If
Loop
file2.Close
strLogEntry = "Lines that are in file1 but not in file2:" & vbCrLf & strLogEntry
logFile.WriteLine strLogEntry
objFile3.Close