How to Convert a Local Spreadsheet Range to a CSV File: Step‑by‑Step Guide
Export a specific range from a local Excel file to CSV using the Aspose.Cells Cloud API.
Convert Range to CSV API
Prerequisites
To call this endpoint you must have a valid Aspose Cloud client ID and client secret, obtain a JWT access token, and ensure the source spreadsheet is in XLSX or XLS format.
Web API
PUT https://api.aspose.cloud/v4.0/cells/convert/range/csv
cURL example
curl -X PUT "https://api.aspose.cloud/v4.0/cells/convert/range/csv?worksheet=Sheet1&range=A1:C10" \
-H "Authorization: Bearer {access_token}" \
-F "Spreadsheet=@sample.xlsx"
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters:
| Parameter Name | Type | Path/Query String/HTTPBody | Description |
|---|---|---|---|
| Spreadsheet | File | FormData | Upload the spreadsheet file. |
| worksheet | String | Query | The worksheet name of the spreadsheet. |
| range | String | Query | Specify the cell area (e.g., A1:C10). |
| outPath | String | Query | The folder path where the workbook will be stored (optional). Default is null. |
| outStorageName | String | Query | Name of the output storage. |
| fontsLocation | String | Query | Specify custom fonts if required. |
| region | String | Query | Defines the spreadsheet region setting. |
| password | String | Query | Password required to open the spreadsheet file. |
Response
[
{
"Name": "ResponseFile",
"DataType": {
"Identifier": "File",
"Reference": "Stream"
}
}
]
Example CSV content returned (first few rows):
Name,Date,Amount
John Doe,2023-01-15,1250.00
Jane Smith,2023-01-16,980.50
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Filter applied successfully; response contains operation details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
Where should you use the Convert Range to CSV API?
1. Data Export & Migration Scenarios
- Database Integration: Export specific Excel ranges directly to database systems.
- Application Integration: Feed selected spreadsheet data into SaaS applications.
- System Migration: Transfer specific data ranges between legacy and modern systems.
- Cross‑Platform Sharing: Share focused data subsets across different platforms.
2. Reporting & Analytics
- Targeted Reporting: Export specific report sections to CSV for focused analysis.
- Dashboard Data Feeds: Supply specific data ranges to BI dashboard tools.
- Performance Metrics: Extract KPI ranges for performance‑tracking systems.
- Financial Reporting: Export financial‑statement sections for external auditing.
3. Development & Testing
- Test Data Management: Export specific data ranges for testing purposes.
- Development Environments: Share sample data ranges with development teams.
- API Testing: Generate CSV test data from specific spreadsheet sections.
- Prototype Development: Provide focused data sets for application prototypes.
4. Business Operations
- Selective Data Sharing: Share specific data ranges with external partners.
- Partial Data Backup: Backup critical data ranges in CSV format.
- Departmental Data Transfer: Share specific data between departments.
- Compliance Reporting: Export regulatory data ranges for compliance submissions.
5. Automation Workflows
- Scheduled Range Exports: Automatically export specific ranges on a schedule.
- Trigger‑Based Extraction: Export ranges based on business events or triggers.
- Workflow Integration: Integrate range exports into business‑process workflows.
- Batch Range Processing: Process multiple specific ranges in batch operations.
Why should you use the Convert Range to CSV API?
- You can convert a spreadsheet range without first uploading the workbook, which saves storage space and reduces costs.
- Development can be completed quickly using the existing Aspose.Cells Cloud SDKs.
- Simple Integration: REST API with clear documentation.
- Scalable Architecture: Handles everything from small to enterprise‑scale operations.
How to Use the Convert Range to CSV API with SDKs?
OpenAPI Specification
The OpenAPI Specification outlines a publicly accessible API, enabling REST interactions directly from a web browser.
Use Aspose.Cells Cloud SDKs
Using the SDK is the fastest way to develop, as it abstracts away the low‑level details, allowing you to convert a range of data to a CSV file with minimal code.
Explore the complete list of Aspose.Cells Cloud SDKs in our GitHub repository.
The following code examples illustrate how to call Aspose.Cells web services using various SDKs. If loading from Gist is blocked, you can download the examples directly from the repository.