Free Support Forum - groupdocs.com

Compare and return the entire line that is changed using .NET

Is it possible to return entire line where a change was detected, or retrieve that line from the coordinates?

1 Like

@shopkinss99,

When you compare two documents, API provides a list that contains changes or differences between those two documents. Can you please further elaborate your use-case and also specify your development environment (e.g. Java, .NET). We’ll then assist you accordingly.

Hi, i see the collection of changeInfo objects, and the text that was changed. what i need is the entire line from the file where the change occurred as i want to drop some of the changes if the lines starts with certain words. using the Microsoft.Office.Interop.Word compare method i can get that line from the revisons.range.sentences property. Is there any way to get that using Comparer?

1 Like

@shopkinss99,

Please specify your development environment (e.g. Java, .NET). We’ll then investigate this scenario.

C# .NET environment

1 Like

@shopkinss99,

We are investigating this scenario. Your investigation ticket ID is COMPARISONNET-2213. As there’s any further update, you’ll be notified.

@shopkinss99,

We have a list of changes, and we could apply or discard from specific position of text fragment. Have a look at this screenshot.png (132.2 KB)

We could reject all changes using following code:

for (n = 0; n < 3; n++)
{
   changes[n].ComparisonAction = ComparisonAction.Reject;
}

If this is not what you are looking for. Please further elaborate your requirements with the help of some use-cases or example screenshots.

Hi,
the situation is i’m comparing the same rtf document that consists of tabular data from 2 time points. i need to identify changes (which i can do with Comparer no problem) but i also need the contents of the cell in the table where the change occured.

Example:
Old document = “Treatment Group A” New document = “Treatment Group B”
Comparer will give me A deletion and B insertion, but i also need to get the contents of the entire cell “Treatment Group B”

1 Like

@shopkinss99,

Thanks for the clarification. We’ll now investigate this scenario.

@shopkinss99,

For now API can’t return the entire line where the change occurred. However, we will try to implement this feature in any of the future releases.