PNG JPG BMP TIFF ODS
Aspose.Cells  for .NET

搜尋 ODS C# 中的格式

使用伺服器端 Aspose.Cells for .NET API 進行本機高效能 ODS 文件搜索,無需使用 Microsoft 或 Adobe PDF 等任何軟體。

如何使用 C# 搜尋 ODS 文件

為了搜尋 ODS 文件,我們將使用

Aspose.Cells for .NET

API這是一個功能豐富、功能強大且易於使用的文件搜尋API for C#平台。打開

NuGet

套件管理器,搜尋 Aspose.Cells 並安裝。您也可以從套件管理器控制台使用以下命令。

命令


PM> Install-Package Aspose.Cells

搜尋 C# 中的 ODS 文件的步驟

基本文件搜尋

Aspose.Cells for .NET

只需幾行程式碼即可完成 API。

使用 Workbook 類別載入 ODS 檔案。 取得相關工作表中的儲存格。

  • 使用查找方法搜尋 Numbers、日期和文本

系統需求

我們的 API 在所有主要平台和作業系統上均受支援。在執行下面的程式碼之前,請確保您的系統符合以下先決條件。

  • Microsoft Windows 或具有 .NET Framework、.NET Core、Mono 或 Xamarin 平台的相容作業系統
  • 開發環境如Microsoft Visual Studio
  • 在專案中新增對 Aspose.Cells for .NET DLL 的引用 - 使用上面的下載按鈕從 NuGet 安裝
 

搜尋 ODS 文件 - C#

// searching cells containing specified string value or number
Workbook workbook = new Workbook("book1.ods");

// get cells collection
Cells cells = workbook.Worksheets[0].Cells;

FindOptions opts = new FindOptions();
opts.LookInType = LookInType.Values;
opts.LookAtType = LookAtType.EntireContent;

// find the cell with the input integer or double
Cell cell1 = cells.Find(205, null, opts);

if (cell1 != null){
    Console.WriteLine("Name of the cell containing the value: " + cell1.Name);
}else{
    Console.WriteLine("Record not found ");
}

// find the cell with the input string
Aspose.Cells.Cell cell2 = cells.Find("Items A", null, opts);

if (cell2 != null){
    Console.WriteLine("Name of the cell containing the value: " + cell2.Name);
}else{
    Console.WriteLine("Record not found ");
}

// find the cell containing with the input string
opts.LookAtType = LookAtType.Contains;
Cell cell3 = cells.Find("Data", null, opts);

if (cell3 != null){
    Console.WriteLine("Name of the cell containing the value: " + cell3.Name);
}else{
    Console.WriteLine("Record not found ");
}  
 
  • 關於 Aspose.Cells for .NET API

    Aspose.Cells API 可用於建立、編輯、轉換和渲染 Microsoft Excel 格式為不同的格式。此外,它還可用於軟體應用程式中的全面圖表、可擴展報告和可靠計算。 Aspose.Cells 是一個獨立的 API,它不需要任何像 Microsoft 或 OpenOffice 這樣的軟體。

    線上 ODS 搜尋現場演示

    立即造訪我們的 ODS 文件中搜尋文字、單字、片語 現場示範網站 。現場演示有以下好處

      無需下載Aspose API。
      無需編寫任何程式碼。
      只需上傳您的 ODS 文件即可。
      搜尋結果立即出現。

    ODS 什麼是 ODS 文件格式

    副檔名為 ODS 的檔案代表可由使用者編輯的 OpenDocument 電子表格文件格式。資料按行和列儲存在 ODF 檔案內。它是基於 XML 的格式,並且是開放文件格式 (ODF) 系列中的幾個子類型之一。此格式被指定為 OASIS 發布和維護的 ODF 1.2 規範的一部分。 Windows 以及其他作業系統上的許多應用程式都可以開啟 ODS 檔案進行編輯和操作,包括 Microsoft Excel、NeoOffice 和 LibreOffice。 ODS 文件還可以透過不同的應用程式轉換為其他電子表格格式,例如 XLS、XLSX 等。

    閱讀更多

    其他支援的搜尋格式

    使用C#,還可以搜尋其他格式,包括。

    CSV (逗號分隔值)
    TSV (製表符分隔值)
    TXT (文字文檔)
    XLS (Excel 二進位格式)
    XLSB (二進位 Excel 工作簿文件)
    XLSM (試算表文件)