Convert CSV to Excel in Ruby

gem 'cloudmersive-convert-api-client', '~> 2.1.6'
# load the gem
require 'cloudmersive-convert-api-client'
# setup authorization
CloudmersiveConvertApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveConvertApiClient::ConvertDocumentApi.newinput_file = File.new('/path/to/inputfile') # File | Input file to perform the operation on.begin
#Convert CSV to Excel XLSX Spreadsheet
result = api_instance.convert_document_csv_to_xlsx(input_file)
p result
rescue CloudmersiveConvertApiClient::ApiError => e
puts "Exception when calling ConvertDocumentApi->convert_document_csv_to_xlsx: #{e}"
end

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Active Record Associations

Realtime Streaming Data Pipeline On Azure Cloud Platform

Statistics For Data Science with Python — Distributions (4/10)

Introducing G|Code’s Change Makers: Kayla Griffith

Code: Update objects like a pro in Swift (3 of 3)

Guidance on HashiCorp Certified — Terraform Associate

The Shadow Drive — Decentralized Storage Optimized for Solana

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

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

More from Medium

SerpApi’s Easy Integration and our Supported Language Libraries (cURL, Ruby, Python, Node.js,

Deploying Rails 6 application on Ubuntu using Capistrano, Puma and Nginx

How I learned Yocto Project and Qt and why you would do the same

Updating contents of GitHub repositories via Ruby