Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

An action through the Preferentum library compares two text documents using the "Version comparison" rule and returns a file with annotations in the first document, as well as a dictionary with the specified annotations. A "Version comparison" rule is a Preferentum library rule that compares two documents for similarity and highlights any differences in the form of an annotation and in a visual representation.

Action icon

Parameters

...

Input parameters

...

Path to the text document to be compared.

Acceptable extensions - doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml. The extension must be the same as "Document 2"

...

Document 2

...

Path to the text document to be compared. 

Valid extensions - doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml. The extension must be the same as "Document 1"

...

Boolean parameter. If the value is "true" and a file with the same name exists in the specified folder, the new file will overwrite it.

If "false", the document will not be overwritten and the action will return an error

...

Time limit for waiting for the comparison result. It is measured in milliseconds. It can be any number. 

Minus in negative numbers will be ignored. Timeout starts counting from the moment of Preferentum library operation

and their settings

Output parameters

...

The path to the file where the first document with the marked edits obtained by comparing it with the second document is written. The name of the file is taken from the "File name" parameter.

The extension of the new file depends on the extension of the submitted documents:

  • If "Document 1" and "Document 2" specify .docx extension files, a .docx extension file will be created
  • If "Document 1" and "Document 2" have .xlsx extension files, then a .xlsx extension file will be created
  • If "Document 1" and "Document 2" contain files with other valid extensions, the .html extension file will be created.
  • If "Document 1" and "Document 2" contain .docx/.xlsx extension files of version 2003, the .html extension file will be created

...

Table. The first column is the beginning of the text range to which the difference applies. The second column is the end of the range. The third column is the description of the difference.

Example: 

...

Settings

Property

Description

Type

Example

Mandatory field

Parameters

Document 1

Path to the file of the first document to be compared. Acceptable formats: doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml. The format must match the file from the "Document 2" field

File path

file1.doc

Yes

Document 2

Path to the file of the second document to be compared. Acceptable formats: doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml. The format must match the file from the "Document 1" field

File path

file2.doc

Yes
Folder pathPath to the folder where a new file will be created containing the first document with the marked differences found when comparing the documents.

Folder path

C:\Users\admin\DesktopYes
File nameThe name of the file (without extension) where the first document with marked differences that were found when comparing documents will be writtenStringtestYes
OverwriteIf the value is "true" and a file with the same name and extension exists in the specified folder, the new file will overwrite it. If "false", the file will not be overwritten and the action will return an errorBooleanДаNo
Timeout, msLimit time to wait for the comparison result. It is specified in millisecondsNumeric10000No
Results

Document with differences

Path to the file containing the first document, where the differences from the second document are marked. If the format of the source documents is "docx", the file "docx" will be created. If the format is "xlsx", the file "xlsx" will be created. If the format of the source documents is different, the file "html" will be created

File path



Differences
Table with a list of differences between documents. The first column is the beginning of the range of text in the first document, where the difference from the second document is found. The second column is the end of the range. The third column is a description of the difference between the documents
Table

Special conditions of use 

If there are no differences in the document, a file without notes is created (Document 1). The action will return the path to this file and an empty table.

  1. Document with differences. The path to the file where the first document with the marked edits obtained by comparing it with the second document is written. The name of the file is taken from the "File name" parameter. The extension of the new file depends on the extension of the submitted documents:
    • If "Document 1" and "Document 2" specify .docx extension files, a .docx extension file will be created
    • If "Document 1" and "Document 2" have .xlsx extension files, then a .xlsx extension file will be created
    • If "Document 1" and "Document 2" contain files with other valid extensions, the .html extension file will be created.
    • If "Document 1" and "Document 2" contain .docx/.xlsx extension files of version 2003, the .html extension file will be created
  2. Differences. Table. The first column is the beginning of the text range to which the difference applies. The second column is the end of the range. The third column is the description of the difference. Example: 
    5869Footnote 1 of paragraph 2 delete.
    123250Footnote 1 delete.

Example of use

Task

Two documents need to be compared.

...