Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 6 Следующий »

Compare documents Version 1 (Net)

Group "Robin AI", subgroup "Document verification"

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

Parameters

Input parameters

NameDescription
Document 1

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"

Folder pathPath to the folder where the new file will be written. The file will contain Document 1 with the marked edits
File nameThe name for the new file to which Document 1 with the marked edits will be written. The following characters are not allowed in the name \/:* ?"<>| +
Overwrite

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

Timeout, ms

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

Output parameters

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

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

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

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

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

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

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

Отличия

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

Пример: 

5869Сноску 1 пункта 2 исключить.
123250Сноску 1 исключить.

Настройки

  • "Имя файла" - имя для нового файла, в который будет записан Документ 1 с отмеченными правками. В названии недопустимы следующие символы   \/:* ?"<>| +
  • "Перезаписать" - логический параметр. Если значение «true», и в указанной папке существует файл с таким же именем, то новый файл его перезапишет. Если «false», документ перезаписан не будет и действие вернет ошибку.
  • "Тайм-аут, мс" - предельное время ожидания результата сравнения. Измеряется в миллисекундах. Может быть любым числом. Минус в отрицательных числах будет игнорироваться. Тайма-аут начинает отсчет с момента работы библиотеки Preferentum.

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

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

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

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

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

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

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

Пример: 




5869Сноску 1 пункта 2 исключить.
123250Сноску 1 исключить.

Настройки

Свойство

Описание

Тип

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

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

Параметры

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 written.StringtestYes
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 error.BooleanДаNo
Timeout, msLimit time to wait for the comparison result. It is specified in milliseconds.Numeric10000No
Результаты

 

Свойство

Описание

Тип

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

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

Параметры

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
Результаты

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

Путь к файлу



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
Таблица

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

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

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

Задача

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

Решение

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

Реализация

  1. Перетащить на рабочую область действие "Сравнить документы".




  2. Заполнить параметры корректными данными.

  3. Нажать на кнопку "Старт" в верхней панели.

Результат

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

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.

 


  • Нет меток