# Get source and target text from files This article explains how to get source and target texts of specific changes using GroupDocs.Comparison for .NET. [GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to get source and target texts of specific changes in the output file. To get a list of changed source and target texts, follow these steps: 1. Instantiate the [Comparer](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer) object. Specify the source document path or stream. 2. Call the [Add](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer/methods/add/index) method. Specify the target document path or stream. 3. Call the [Compare](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer/methods/compare) method. 4. Call the [GetChanges](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer/methods/getchanges) method. The following code snippets show how to get specified texts from a file. ## Get source and target text from local disk {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using System; using GroupDocs.Comparison; using GroupDocs.Comparison.Result; // ... using (Comparer comparer = new Comparer("source.docx")) { comparer.Add("target.docx"); comparer.Compare("result.docx"); ChangeInfo[] changes = comparer.GetChanges(); foreach (ChangeInfo change in changes) { Console.WriteLine(""); Console.WriteLine("Source text: " + change.SourceText); Console.WriteLine("Target text: " + change.TargetText); } } ``` {{< /tab >}} {{< /tabs >}} The result is as follows: ![](https://docs.groupdocs.com/comparison/net/images/get-source-and-target-text-from-files.png) ## Get source and target text from stream {{< tabs "example2">}} {{< tab "C#" >}} ```csharp using System; using GroupDocs.Comparison; using GroupDocs.Comparison.Result; using System.IO; // ... using (Comparer comparer = new Comparer(File.OpenRead("source.docx"))) { comparer.Add(File.OpenRead("target.docx")); comparer.Compare("result.docx"); ChangeInfo[] changes = comparer.GetChanges(); foreach (ChangeInfo change in changes) { Console.WriteLine(""); Console.WriteLine("Source text: " + change.SourceText); Console.WriteLine("Target text: " + change.TargetText); } } ``` {{< /tab >}} {{< /tabs >}}