Search Content in a Remote Spreadsheet Search for specified text in a remote spreadsheet.
Search Content in Remote Spreadsheet API
Copy PUT http://api.aspose.cloud/v4.0 /cells/{name}/search/content
Request Parameters:
Parameter Name
Type
Path/Query String/HTTPBody
Description
name
String
Path
The name of the workbook file to search.
searchText
String
Query
The text to search for in the spreadsheet.
ignoringCase
Boolean
Query
Indicates whether to ignore case in the search.
folder
String
Query
The folder path where the workbook is stored.
storageName
String
Query
(Optional) The name of the custom cloud storage. Default storage is used if omitted.
region
String
Query
The spreadsheet region setting.
password
String
Query
The password for opening 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 remote spreadsheet with this API.
Development can be quickly completed through the existing SDK.
How to Use the Search for broken links within the range of the Spreadsheet API with SDKs
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and enables you to 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 illustrate how to invoke 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_SearchTextInRemoteSpreadsheet
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string remoteFolder = "TestData/In";
string bookTextXlsx = "BookText.xlsx";
var request = new SearchContentInRemoteSpreadsheetRequest(
name: bookTextXlsx,
searchText: "Bike",
ignoringCase: false,
folder: remoteFolder
);
cellsApi.SearchContentInRemoteSpreadsheet(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 ExampleSearchContentInRemoteSpreadsheet {
private CellsApi api;
public ExampleSearchContentInRemoteSpreadsheet(){
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 remoteFolder = "TestData/In";
String bookTextXlsx = "BookText.xlsx";
UploadFileRequest uploadFileRequest = new UploadFileRequest();
uploadFileRequest.setPath( remoteFolder + "/" + bookTextXlsx );
uploadFileRequest.setStorageName( "");
HashMap<String,File> files = new HashMap<String,File>();
files.put( bookTextXlsx , new File(bookTextXlsx ));
uploadFileRequest.setUploadFiles(files);
cellsApi.uploadFile(uploadFileRequest);
SearchContentInRemoteSpreadsheetRequest request = new SearchContentInRemoteSpreadsheetRequest();
request.setName(bookTextXlsx);
request.setSearchText("Bike");
request.setIgnoringCase(false);
request.setFolder(remoteFolder);
this.api.searchContentInRemoteSpreadsheet(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\SearchContentInRemoteSpreadsheetRequest;
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 SearchContentInRemoteSpreadsheetRequest();
$request->setName( "BookText.xlsx");
$request->setSearchText( "Bike");
$request->setIgnoringCase( 'false');
$request->setFolder( "TestData");
$cellsApi->searchContentInRemoteSpreadsheet($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'])
remote_folder = 'TestData/In'
book_text_xlsx = 'BookText.xlsx'
mapFiles = { }
mapFiles[book_text_xlsx] = ::File.open(File.expand_path("TestData/"+book_text_xlsx),"r")
uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
@instance.upload_file(uploadrequest)
request = AsposeCellsCloud::SearchContentInRemoteSpreadsheetRequest.new(:name=>book_text_xlsx,:searchText=>'Bike',:ignoringCase=>false,:folder=>remote_folder);
@instance.search_content_in_remote_spreadsheet(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 remoteFolder = "TestData/In"
var bookTextXlsx = "BookText.xlsx"
var bookTextXlsxRequest = new model.UploadFileRequest();
bookTextXlsxRequest.uploadFiles ={bookTextXlsx:fs.createReadStream(localPath + bookTextXlsx)};
bookTextXlsxRequest.path = remoteFolder + "/" + bookTextXlsx ;
bookTextXlsxRequest.storageName ="";
cellsApi.uploadFile(bookTextXlsxRequest );
var request = new model.SearchContentInRemoteSpreadsheetRequest();
request.name = bookTextXlsx;
request.searchText = "Bike";
request.ignoringCase = false;
request.folder = remoteFolder;
return cellsApi.searchContentInRemoteSpreadsheet(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'))
remote_folder = 'TestData/In'
book_text_xlsx = 'BookText.xlsx'
request = UploadFileRequest( book_text_xlsx, remote_folder + '/' + book_text_xlsx,storage_name= '')
api.upload_file(request)
request = SearchContentInRemoteSpreadsheetRequest( book_text_xlsx, 'Bike',ignoring_case= False,folder= remote_folder)
api.search_content_in_remote_spreadsheet(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 $remoteFolder = 'TestData/In';
my $bookTextXlsx = 'BookText.xlsx';
my $upload_file_request = AsposeCellsCloud::Request::UploadFileRequest->new( 'UploadFiles'=>{ $bookTextXlsx => $bookTextXlsx } ,'path'=>$remoteFolder . '/' . $bookTextXlsx );
my $request = AsposeCellsCloud::Request::SearchContentInRemoteSpreadsheetRequest->new();
$request->{name} = $bookTextXlsx;
$request->{search_text} = 'Bike';
$request->{ignoring_case} = 'false';
$request->{folder} = $remoteFolder;
$instance->search_content_in_remote_spreadsheet(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"))
remoteFolder := "TestData/In"
bookTextXlsx := "BookText.xlsx"
bookTextXlsxRequest := new(asposecellscloud.UploadFileRequest)
bookTextXlsxRequest.UploadFiles = bookTextXlsx
bookTextXlsxRequest.Path = remoteFolder + "/" + bookTextXlsx
bookTextXlsxRequest.StorageName = ""
instance.UploadFile(bookTextXlsxRequest)
request := new(asposecellscloud.SearchContentInRemoteSpreadsheetRequest)
request.Name = bookTextXlsx
request.SearchText = "Bike"
request.IgnoringCase = false
request.Folder = remoteFolder
_, httpResponse, err := instance.SearchContentInRemoteSpreadsheet(request)
if err != nil {
print(err.Error())
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
print("Fail")
}
}