![TSV to Excel](images/convert-tsv-to-xls.jpg#center)
TSV to Excel conversion using C# .NET.
TSV (Tab-Separated Values) files are simple and lightweight, making them ideal for data storage and transfer. However, Excel workbook offers advanced features such as data visualization, analysis tools, and user-friendly interfaces, which are essential for in-depth data manipulation and presentation. In this article, we are going to convert TSV files to Excel and leverage the powerful features to enhance your data analysis capabilities, streamline workflows, and improve data presentation.
TSV to Excel Conversion SDK
Aspose.Cells Cloud SDK for .NET offers a powerful and efficient way to convert TSV (Tab-Separated Values) files to Excel format, streamlining the data transformation process. By utilizing Aspose.Cells Cloud SDK, you can automate the conversion of TSV files to Excel, ensuring accuracy and preserving data integrity.
So in order to use the SDK, first you need to search Aspose.Cells-Cloud
in NuGet packages manager and click the Add Package
button. Secondly, obtain your client credentials from cloud dashboard. In case you do not have an existing account, simply create a free account by following the instructions specified in the quick start article.
Convert TSV to XLS in C#
Let’s explore the details on how we can efficiently handle large volumes of data and integrate robust conversion capabilities into your applications, enhancing overall productivity and data management workflows.
CellsApi cellsInstance = new CellsApi(clientID, clientSecret);
Firstly, initialize an object of CellsApi class where we pass the client credentials as arguments.
SaveOptions saveOptions = new SaveOptions()
Secondly, create an instance of SaveOptions where we define the output file format as XLS
.
PostWorkbookSaveAsRequest postworkbookSaveAsRequest = new PostWorkbookSaveAsRequest()
Thirdly, create an instance of PostWorkbookSaveAsRequest
where we specify the name of input TSV, name of resultant Excel workbook and other optional parameters.
var response = cellsInstance.PostWorkbookSaveAs(postworkbookSaveAsRequest);
Finally, call the API to initiate the TSV to Excel conversion process. Once the code is successfully executed, the resultant Excel workbook is saved in the cloud storage.
A preview of TSV to Excel conversion.
The input TSV and the resultant Excel generated in the above example can be downloaded from input.tsv and myResultant.xls.
TSV to XLSX using cURL Commands
Converting TSV to XLSX using Aspose.Cells Cloud and cURL commands is a straightforward and efficient process. This approach is highly beneficial for automation and batch processing, making it ideal for integrating into scripts and workflows that require frequent data transformations.
The first step in this approach is to generate a JWT access token using the following command:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=XXXXXXX-b195-426c-85f7-XXXXXXXX&client_secret=XXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Now, in order to perform the TSV to XLSX conversion, please execute the following command:
curl -v "https://api.aspose.cloud/v3.0/cells/{sourceFile}?format=xlsx&isAutoFit=false&onlySaveTable=false&outPath={resultantFile}" \
-X GET \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}"
Replace sourceFile
with the name of input TSV file (available in the cloud storage), resultantFile
with the name of output Excel workbook and accessToken
with JWT access token generated above.
- In order to save the resultant XLSX workbook to a local drive, please use the following cURL command:
curl -v "https://api.aspose.cloud/v3.0/cells/input.tsv?format=xlsx&isAutoFit=false&onlySaveTable=false" \
-X GET \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-o "MyConverted.xlsx"
Free TSV to XLSX Conversion App
In order to experience the capabilities of .NET REST API, you may consider using our lightweight and supper-efficient TSV to XLSX Conversion App. This free App is built on top of Aspose.Cells Cloud APIs and can be tested online without any installation requirements.
Free TSV to XLSX conversion App
Conclusion
In conclusion, converting TSV to Excel format is a critical task for enhancing data manipulation, visualization, and analysis. Whether you opt for the powerful and flexible Aspose.Cells Cloud SDK for .NET or the straightforward and scriptable cURL commands with Aspose.Cells Cloud API, both approaches offer robust solutions for this conversion.
Useful Links
Related Articles
We highly recommend visiting the following blogs: