Find and Replace Text in Remote Worksheet with Aspose.Cells Cloud API
Replace specified text within a particular worksheet of remote Excel files. Update content in targeted spreadsheet sheets efficiently using Aspose.Cells Find and Replace API for precise worksheet editing.
Replace Content in Remote Worksheet API
Web API
PUT https://api.aspose.cloud/v4.0/cells/{name}/worksheets/{worksheet}/replace/content
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
-H "Authorization: Bearer {access_token}"
Request Parameters
| Parameter Name | Type | Path/Query String/HTTPBody | Description |
|---|---|---|---|
| name | String | Path | The name of the workbook file stored in cloud storage to be modified (e.g., "sales_report.xlsx", "budget_2024.xls"). |
| worksheet | String | Path | The name of the specific worksheet where the find‑and‑replace operation will be performed (e.g., "Q1_Sales", "Sheet1"). |
| searchText | String | Query | The text string to search for within the specified worksheet. The search applies to all cells in the worksheet unless further constrained. |
| replaceText | String | Query | The text string that will replace all occurrences of searchText found within the specified worksheet. |
| folder | String | Query | The cloud storage folder path where the source workbook is located (e.g., "/reports/monthly/", "/finance/"). |
| storageName | String | Query | (Optional) The name of the custom cloud storage (e.g., "CorporateS3", "AzureArchive"). If omitted, the default cloud storage for your account is used. |
| region | String | Query | (Optional) Sets the locale for text handling, which may affect character encoding and language‑specific search behavior within the worksheet (e.g., "en-GB", "es-ES"). |
| password | String | Query | (Optional) If the workbook is password‑protected, provide the password to open and modify the file. |
Example request (cURL)
curl -X PUT "https://api.aspose.cloud/v4.0/cells/sales_report.xlsx/worksheets/Sheet1/replace/content?searchText=OldValue&replaceText=NewValue&folder=/reports" \
-H "Authorization: Bearer {access_token}"
Response
{
"Code": 200,
"Status": "OK"
}
Error Codes
| Code | Description | When it occurs |
|---|---|---|
| 400 | Bad Request | The request URI is malformed or required parameters are missing. |
| 401 | Unauthorized | Access token is missing, invalid, or the client credentials are wrong. |
| 404 | Not Found | The specified workbook or worksheet cannot be found. |
| 500 | Internal Server Error | An unexpected error occurred while processing the request. |
Where should we use the Replace content of Worksheet in Remote Spreadsheet API?
- Batch Cloud File Update: Modify the contents of multiple Excel files stored in cloud storage such as AWS S3 and Azure Blob.
- Dynamic population of cloud templates: Batch‑populate dynamic data for report templates stored in the cloud.
- Cross‑region file synchronization: Synchronize the content consistency of Excel files in cloud storage across different geographical regions.
Why should you use the Replace content of Worksheet in Remote Spreadsheet API?
- Developer‑Friendly: Aspose.Cells Cloud offers SDK libraries in multiple languages, enabling quick development and comes with comprehensive documentation. Compared with building custom chart‑rendering solutions, this significantly reduces development workload.
- Reduced Labor Costs: Decreases the need for personnel dedicated to document consolidation.
- Pay‑per‑use: No upfront investment; you only pay for API calls actually used.
- Zero Maintenance Costs: No need to maintain servers, update software, or deal with compatibility issues.
How to Use the Replace content of Worksheet in Remote Spreadsheet API with SDKs
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and allows 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 replace content of worksheet in 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 interact with Aspose.Cells web services using various SDKs: