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

Ключ

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

...

Compare documents Version 1 (Net)

Группа Group "Robin AI", подгруппа subgroup "Сравнить документыDocument verification"

Описание

Действие через библиотеку Preferentum сравнивает два текстовых документа по правилу "Сравнение версий" и возвращает файл с примечаниями в первом документе, а также словарь с указанными примечаниями. Правило "Сравнение версий" - правило библиотеки Preferentum, которое сравнивает два документа на схожесть и выделяет все различия в виде аннотации и в визуальном представлении.

Иконка действия

Image Removed

Параметры

Входные параметры

"Документ 1"                        - путь до текстового документа, который будет сравниваться.

                                                Допустимые расширения - doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml. Расширение должно совпадать с "Документ 2"

"Документ 2"                        - путь до текстового документа, который будет сравниваться. 

                                                Допустимые расширения - doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml.  Расширение должно совпадать с "Документ 1"

"Путь до папки"                   - путь до папки, в который будет записан новый файл. В файле будет указан Документ 1 с отмеченными правками

"Имя файла"                        - имя для нового файла, в который будет записан Документ 1 с отмеченными правками. В названии недопустимы следующие символы   \/:* ?"<>| +

"Перезаписать"                   - логический параметр. Если значение «true», и в указанной папке существует файл с таким же именем, то новый файл его перезапишет.

                                               Если «false», документ перезаписан не будет и действие вернет ошибку

"Тайм-аут, мс"                     - предельное время ожидания результата сравнения. Измеряется в миллисекундах. Может быть любым числом. 

                                               Минус в отрицательных числах будет игнорироваться. Тайма-аут начинает отсчет с момента работы библиотеки Preferentum

Выходные параметры

  1. "Документ с отличиями" - путь до файла, в который записан первый документ с отмеченными правками, полученных при сравнении со вторым документом. Название файла берется из параметра "Имя файла".

                                                          Расширение нового файла зависит от расширения поданных документов:

              • Если в "Документ 1" и "Документ 2" указаны файлы расширения docx, то создастся файл расширения docx

              • Если в "Документ 1" и "Документ 2" указаны файлы расширения xlsx, то создастся файл расширения xlsx

              • Если в "Документ 1" и "Документ 2" указаны файлы других допустимых расширений, то создастся файл расширения html

              • Если в "Документ 1" и "Документ 2" указаны файлы расширений docx/xlsx версии 2003, то создастся файл расширения html"

2. Отличия"                       - таблица. Первый столбец - начало диапазона текста, к которому относится отличие. Второй столбец - конец диапазона. Третий столбец - описание отличия.

Пример: 

...

Description

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

Image Added

Parameters and their settings

Property

Description

Type

Example

Mandatory field

Parameters

Document 1

Path to the file of the first document to be compared. Acceptable formats:

Настройки

Свойство

Описание

Тип

Пример заполнения

Обязательность заполнения поля

Параметры

Документ 1

Путь до файла первого документа, который будет сравниваться. Допустимые форматы: 

doc, docx, xls, xlsx, csv, ppt, pptx, txt, rtf, pdf, html, odf, odt, ods, wps, wpd, xml.

Формат должен совпадать с файлом из поля "Документ 2".

The format must match the file from the "Document 2" field

File path

Путь к файлу

file1.doc
Да

Yes

Документ 2Путь до файла второго документа, который будет сравниваться. Допустимые форматы: 
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.

 Формат должен совпадать с файлом из поля "Документ 1".

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\Desktop
Да
Yes
Имя файлаИмя файла (без расширения), в который будет записан первый документ с отмеченными отличиями, найденными при сравнении документов.СтрокаtestДаПерезаписатьЕсли значение «true», и в указанной папке существует файл с таким же именем и расширением, то новый файл его перезапишет. Если «false», файл перезаписан не будет и действие вернет ошибку.ЛогическийДаНетТайм-аут, мсПредельное время ожидания результата сравнения. Указывается в миллисекундах.Число10000НетРезультаты

Документ с отличиями

Путь до файла, содержащего первый документ, в котором отмечены отличия от второго документа. Если формат исходных документов - "docx", будет создан файл "docx". Если формат - "xlsx", будет создан файл "xlsx". Если у исходных документов иной формат, то будет создан файл "html".

Путь к файлу

ОтличияТаблица со списком отличий между документами. Первый столбец - начало диапазона текста в первом документе, где найдено отличие от второго документа. Второй столбец - конец диапазона. Третий столбец - описание отличия между документами.Таблица

Особые условия использования 

Если отличий в документе нет, то создается файл без примечаний(документ 1). Действие вернет путь до этого файла и пустую таблицу.

Пример использования

Задача

Необходимо сравнить два документа.

Решение

Воспользоваться действием "Сравнить документы".

Реализация

...

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.

Solution

Use the "Compare documents" action.

Implementation

  1. Move the "Compare documents" action to the workspace.
    Image Added

    Image Added

  2. Set the parameters with the correct data.
    Image Added
  3. Click on the "Start" button in the top panel.

Result

The program robot worked successfully. In the specified folder, a file with difference marks was saved. The action also created a table with the differences. 

Image Added

Результат

Программный робот отработал успешно. В указанной папке сохранен файл с отметками отличий. Также действие создало таблицу с отличиями.

Image Removed

Image RemovedImage Added