How to convert Legacy XLS to CSV in C# .NET Framework

Cloudmersive
1 min readJul 20, 2020

--

There are few things more irritating than outdated file formats, but somehow they are still a commonplace occurrence. The best way to deal with them is to convert into something a little more useful, CSV for example. This is by no means simple to perform from scratch, which is why today’s tutorial will demonstrate how to make this happen in just a few minutes, with minimal setup requirements.

First we grab our package using the NuGet console.

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 3.2.8

And next we call our function:

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;namespace Example{public class ViewerToolsCreateSimpleExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new ViewerToolsApi();var inputFile = new System.IO.Stream(); // System.IO.Stream | Input file to perform the operation on.try{// Create a web-based viewerViewerResponse result = apiInstance.ViewerToolsCreateSimple(inputFile);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling ViewerToolsApi.ViewerToolsCreateSimple: " + e.Message );}}}}

And done! No more XLS woes.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet