Convert Multiple CSV Files into a Single XLSX Spreadsheet 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_file1 = File.new('/path/to/inputfile') # File | First input file to perform the operation on.input_file2 = File.new('/path/to/inputfile') # File | Second input file to perform the operation on.opts = {
input_file3: File.new('/path/to/inputfile'), # File | Third input file to perform the operation on.
input_file4: File.new('/path/to/inputfile'), # File | Fourth input file to perform the operation on.
input_file5: File.new('/path/to/inputfile'), # File | Fifth input file to perform the operation on.
input_file6: File.new('/path/to/inputfile'), # File | Sixth input file to perform the operation on.
input_file7: File.new('/path/to/inputfile'), # File | Seventh input file to perform the operation on.
input_file8: File.new('/path/to/inputfile'), # File | Eighth input file to perform the operation on.
input_file9: File.new('/path/to/inputfile'), # File | Ninth input file to perform the operation on.
input_file10: File.new('/path/to/inputfile'), # File | Tenth input file to perform the operation on.
worksheet_names: 'worksheet_names_example' # String | Optional; Specify the name of each CSV's worksheet in order, separated with commas (e.g. \"worksheet1,worksheet2,worksheet3\"). Defaults to the names of the input CSV files. Recommended when inputting the files directly, without file names.
}
begin
#Convert Multiple CSV Files into a Single XLSX Spreadsheet
result = api_instance.convert_document_csv_multi_to_xlsx(input_file1, input_file2, opts)
p result
rescue CloudmersiveConvertApiClient::ApiError => e
puts "Exception when calling ConvertDocumentApi->convert_document_csv_multi_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

AWS Summit San Francisco

Goodbye iOS… Hello Web development

Scrape posts from LinkedIn with this unofficial python api

Pi Zero FM Radio

Host Your Unity Game!

Security testing for REST API with w3af

Security testing for REST API with w3af

An introduction to web scraping with Scrape Owl.

To Expand Your Horizons, You Must Grow Your Language

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

Animated source code statistics with Vizzu

Let’s build a static website in less than 10 minutes and for … FREEEEE

Flask: How to Create Authentication System Without Flask-Login

Flask logo

Hack The Stack