Search ODT Formats in C#
Native and high performance Microsoft Word ODT file search using server-side .NET APIs, without the use of any software like Microsoft or Adobe PDF.
How to Search ODT File Using C#
In order to search ODT file, we’ll use
API which is a feature-rich, powerful and easy to use document searching API for C# platform. Open
package manager, search for Aspose.Words and install. You may also use the following command from the Package Manager Console.
PM> Install-Package Aspose.Words
Steps to Search ODT Files in C#
Developers can easily search Microsoft Word ODT file by following the workflow.
- Load ODT document.
- Just use Replace function to find and replace.
- Also possible with Regex as parameter within Replace method
- Save file.
Our APIs are supported on all major platforms and Operating Systems. Before executing the code below, please make sure that you have the following prerequisites on your system.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
- Development environment like Microsoft Visual Studio
- Aspose.Words for .NET DLL referenced in your project - Install from NuGet using the Download button above
Search ODT Files - C#
Document odt = new Document("../../data/document.odt"); // Replaces all "sad" and "mad" occurrences with "bad" doc.Range.Replace("document", "document replaced", false, true); // Replaces all "sad" and "mad" occurrences with "bad" doc.Range.Replace(new Regex("[s|m]ad"), "bad"); doc.Save("replacedDocument.odt");
Online ODT Search Live Demos
Other Supported Search Formats
Using C#, one can also search other formats including.