Excel Data Cleaner - Convert Text to Numbers & Remove Unwanted Characters

Clean Excel data by converting text-formatted numbers to numeric values, replacing unwanted characters and line breaks, and normalizing accented characters to standard letters with Aspose.Cells API.

Overview

Convert numbers-as-text, strip junk, swap accents—one call, zero formulas.

  • Convert numbers stored as text to numbers: Transform numeric data stored as text to numbers, ensuring accurate calculations and proper data representation.
  • Replace specific characters: Replace all occurrences of specified characters in all the selected cells at once to standardize your information.
  • Convert line breaks to space, comma or semicolon: Improve the readability of your sheets by converting line breaks to space, comma, or semicolon, creating a more organized and visually appealing presentation.
  • Replace accented characters: If your data is in different languages, you have the option to swap accented characters like “é” or “ü” with their non-accented counterparts. This enhances consistency and clarity in your text.

ConvertText API

API Endpoint

PUT http://api.aspose.cloud/v4.0/cells/content/convert/text

The request parameters of convertText API are

Parameter Name Type Path/Query String/HTTPBody Description
Spreadsheet File FormData The spreadsheet file to be processed. Supported formats include XLSX, XLS, ODS, CSV, etc.
convertTextType String Query Specifies the type of text conversion to apply, such as converting text-formatted numbers to numeric values, or converting accented characters to plain equivalents.
sourceCharacters String Query Specifies the characters, strings, or patterns to be replaced or removed from the text (e.g., "é,è,ê", "#N/A", "\\n" for line breaks).
targetCharacters String Query Specifies the replacement characters or strings that will replace the source characters (e.g., "e" for accented letters, "" for removal, " " for line breaks).
worksheet String Query (Optional) The name of the worksheet where text conversion will be applied. If omitted, the operation applies to the first worksheet.
range String Query (Optional) The cell range where text conversion will be applied (e.g., "A1:C10"). If omitted, the operation applies to all used cells in the specified worksheet.
outPath String Query (Optional) The cloud storage folder path where the processed workbook will be saved. If omitted, the file is saved in the source folder.
outStorageName String Query The name of the cloud storage where the output file will be stored.
region String Query (Optional) Sets the locale for text conversion rules, particularly relevant for language-specific character handling (e.g., "en-US", "fr-FR").
password String Query (Optional) If the uploaded spreadsheet is password-protected, provide the password to open and process the file.

Response

{
File
}

Error Codes

  • 400 Bad Request: Invalid Aspose.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 Convert Text API?

  • Number Format Correction: Convert numbers stored as text (e.g., “123.45”) into a calculable numeric format
  • Special Character Cleanup: Remove unnecessary special symbols, extra spaces, or invisible characters from the data
  • Line Break Handling: Replace line breaks in cells with spaces or other delimiters
  • Accent Character Normalization: Convert accented letters (e.g., “é”, “ñ”) to standard letters (“e”, “n”)
  • CSV File Preprocessing: Standardize text format before importing CSV into Excel

Why should you use the Convert Text API?

  • Automatic Format Conversion: Convert text-formatted numbers into calculable values in bulk with one click
  • Character Standardization: Uniformly handle special characters, diacritics, and encoding issues
  • Data Consistency: Ensure that the text format is completely uniform across the entire dataset
  • Developer-Friendly: Aspose.Cells Cloud offers SDK libraries in multiple languages, enabling quick development and comes with comprehensive documentation. Compared to building custom chart rendering solutions, this significantly reduces the development workload.
  • Cost-Effective: You can convert text without first uploading the workbook, which saves storage space and reduces costs.

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 Convert text 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 make calls to Aspose.Cells web services using various SDKs: