Search Spreadsheet Content Search for text within local spreadsheet files using our API.
Search Spreadsheet Content API
Copy PUT http://api.aspose.cloud/v4.0/cells/search/content
Request Parameters:
Parameter Name
Type
Path/Query String/HTTPBody
Description
Spreadsheet
File
FormData
Upload the spreadsheet file to search.
searchText
String
Query
The text to search for within the spreadsheet.
ignoringCase
Boolean
Query
Specify whether to ignore case in the search.
worksheet
String
Query
Specify the worksheet to search within.
cellArea
String
Query
Specify the area of cells to search.
region
String
Query
The region setting for the spreadsheet.
password
String
Query
The password required to open the spreadsheet file.
Response
Copy {
"Name" : "BrokenLinksResponse" ,
"Type" : "Class" ,
"ParentName" : "CellsCloudResponse" ,
"Properties" : [
{
"Name" : "BrokenLinks" ,
"DataType" : {
"Identifier" : "Container" ,
"Reference" : "BrokenLink" ,
"ElementDataType" : {
"Identifier" : "Class" ,
"Reference" : "BrokenLink" ,
},
}
},
{
"Name" : "Code" ,
"DataType" : {
"Identifier" : "Integer" ,
}
},
{
"Name" : "Status" ,
"DataType" : {
"Identifier" : "String" ,
}
}
]
}
Error Codes
400 Bad Request : Invalid Apose.Cells Cloud API URI.
401 Unauthorized : Invalid access token. Or invalid client id and secret.
404 Not Found : The spreadsheet file not accessible.
500 Server Error : The spreadsheet has encountered an anomaly in obtaining calculation data.
Where should we use the Search content within the Spreadsheet API?
When you need to Search content within the Spreadsheet, you can use this API.
Why should you use the Search content within the Spreadsheet API?
Effortlessly search content within a spreadsheet with this API.
Development can be quickly completed through the existing SDK.
How to Use the Search for broken links within the Spreadsheet API with SDKs
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
Use Aspose.Cells Cloud SDKs
Using the SDK is the best way to accelerate development. The SDK handles the underlying details, allowing you to simply implement search content within spreadsheets for cells with minimal code.
Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Model;
using Aspose.Cells.Cloud.SDK.Request;
using System;
using System.IO;
using System.Collections.Generic;
using Range = Aspose.Cells.Cloud.SDK.Model.Range;
public static class Example40_SearchTextInLocalFile
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string bookTextXlsx = "BookText.xlsx";
var request = new SearchSpreadsheetContentRequest(
spreadsheet: "TestData/" + bookTextXlsx,
searchText: "Bike",
ignoringCase: false
);
cellsApi.SearchSpreadsheetContent(request);
}
}
Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class ExampleSearchSpreadsheetContent {
private CellsApi api;
public ExampleSearchSpreadsheetContent(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String bookTextXlsx = "BookText.xlsx";
SearchSpreadsheetContentRequest request = new SearchSpreadsheetContentRequest();
request.setSpreadsheet("TestData/" + bookTextXlsx);
request.setSearchText("Bike");
request.setIgnoringCase(false);
this.api.searchSpreadsheetContent(request);
} catch (ApiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php
require_once('vendor\autoload.php');
use \Aspose\Cells\Cloud\Api\CellsApi;
use \Aspose\Cells\Cloud\Request\SearchSpreadsheetContentRequest;
use \Aspose\Cells\Cloud\Request\UploadFileRequest;
$cellsApi = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"));
$request = new UploadFileRequest();
$request->setUploadFiles( "TestData/BookText.xlsx");
$request->setPath( "TestData/BookText.xlsx");
$cellsApi->uploadFile($request);
$request = new SearchSpreadsheetContentRequest();
$request->setSpreadsheet( "TestData/BookText.Xlsx" );
$request->setSearchText( "Bike");
$request->setIgnoringCase( 'false');
$cellsApi->searchSpreadsheetContent($request);
Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl'
require 'bundler'
require 'aspose_cells_cloud'
@instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
book_text_xlsx = 'BookText.xlsx'
request = AsposeCellsCloud::SearchSpreadsheetContentRequest.new(:Spreadsheet=>'TestData/' + book_text_xlsx,:searchText=>'Bike',:ignoringCase=>false);
@instance.search_spreadsheet_content(request);
Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs');
var path = require('path');
const _ = require('asposecellscloud');
const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret,"v3.0",process.env.CellsCloudApiBaseUrl);
var bookTextXlsx = "BookText.xlsx"
var request = new model.SearchSpreadsheetContentRequest();
request.spreadsheet = "TestData/" + bookTextXlsx;
request.searchText = "Bike";
request.ignoringCase = false;
return cellsApi.searchSpreadsheetContent(request).then((result) => {
expect(result.response.statusCode).to.equal(200);
});
Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
book_text_xlsx = 'BookText.xlsx'
request = SearchSpreadsheetContentRequest( 'TestData/' + book_text_xlsx, 'Bike',ignoring_case= False)
api.search_spreadsheet_content(request)
Perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lib 'lib';
use strict;
use warnings;
use File::Slurp;
use MIME::Base64;
use AsposeCellsCloud::CellsApi;
my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'CellsCloudClientId'}, client_secret => $ENV{'CellsCloudClientSecret'});
my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
my $bookTextXlsx = 'BookText.xlsx';
my $request = AsposeCellsCloud::Request::SearchSpreadsheetContentRequest->new();
$request->{spreadsheet} = 'TestData/' . $bookTextXlsx;
$request->{search_text} = 'Bike';
$request->{ignoring_case} = 'false';
$instance->search_spreadsheet_content(request=> $request);
Go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main
import (
"os"
asposecellscloud "github.com/aspose-cells-cloud/aspose-cells-cloud-go/v25"
)
func main() {
instance := asposecellscloud.NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"))
bookTextXlsx := "BookText.xlsx"
request := new(asposecellscloud.SearchSpreadsheetContentRequest)
request.Spreadsheet = "TestData/" + bookTextXlsx
request.SearchText = "Bike"
request.IgnoringCase = false
_, httpResponse, err := instance.SearchSpreadsheetContent(request)
if err != nil {
print(err.Error())
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
print("Fail")
}
}