0.0
No commit activity in last 3 years
No release in over 3 years
rubyXL wrapper to treat single-sheet XLSX files like CSV.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.2.6
 Project Readme

Build Status

SingleXLSX

SingleXLSX wraps rubyXL to read and write single-sheet XLSX files like ruby's standard CSV library.

Installation

Add this line to your application's Gemfile:

gem 'single_xlsx'

And then execute:

$ bundle

Or install it yourself as:

$ gem install single_xlsx

Usage

Read

You can read XLSX files into Array of Array.

Name Age
Einstein 76
Feynman 69
require "single_xlsx"

SingleXLSX.read("path/to/xlsx")
#=> [
      ["Name", "Age"],
      ["Einstein", 76],
      ["Feynman", 69]
    ]

Write

You can write XLSX data into String.

require "single_xlsx"

binary = SingleXLSX.generate do |sheet|
  sheet << ["Name", "Age"]
  sheet << ["Einstein", 76]
  sheet << ["Feynman", 69]
end

or into a file.

require "single_xlsx"

SingleXLSX.open("path/to/xlsx") do |sheet|
  sheet << ["Name", "Age"]
  sheet << ["Einstein", 76]
  sheet << ["Feynman", 69]
end

Contributing

  1. Fork it ( https://github.com/a2ikm/single_xlsx/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request