Javascript 在没有字体格式的命令行中比较word文档
我刚收到通知。 并尝试通过(diff doc.js)比较两个word文件,但我发现它显示了字体或段落设置的许多差异Javascript 在没有字体格式的命令行中比较word文档,javascript,vbscript,ms-word,Javascript,Vbscript,Ms Word,我刚收到通知。 并尝试通过(diff doc.js)比较两个word文件,但我发现它显示了字体或段落设置的许多差异 是否有关于如何修改diff-doc.js以忽略字体更改和忽略段落格式更改的代码示例?我只想在第一时间关注文本内容。我不是100%确定你在问什么,但你可以在vbscript中执行以下操作: strPath1 = [the location of the first file] strPath2 = [the location of the second file] strLog =
是否有关于如何修改diff-doc.js以忽略字体更改和忽略段落格式更改的代码示例?我只想在第一时间关注文本内容。我不是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
检查此文件:这是用于.txt文件的。我重读了你问的“医生”档案。我会尽量调整我的答案。对不起,你不明白我的意思。试试diff-doc.js就行了。我只是希望它默认关闭显示字体修改。哦,那我的答案就没有意义了。