FastXlsToHash
This gem can to convert your xls to hash ! Really cool ! It's amazing gem, it's true.
example: { :list_1 =>
{ :row_1 =>
{ :column_1 => 'value',
:column_2 => 100,
:column_3 => #<DateTime: 2016-11-01T00:00:00+00:00>
},
:row_2 =>
{ :column_1 => 'value2',
:column_2 => 200,
:column_3 => #<DateTime: 2016-12-01T00:00:00+00:00>
}
},
:list_2 => {...}
}
or if you want to use xls style of names
FastXlsToHash.with_xls_style = true
example: { :list_1 =>
{ :'1' =>
{ :A => 'value',
:B => 100,
:C => #<DateTime: 2016-11-01T00:00:00+00:00>
},
:'2' =>
{ :A => 'value2',
:B => 200,
:C => #<DateTime: 2016-12-01T00:00:00+00:00>
}
},
:list_2 => {...}
}
Installation
Add this line to your application's Gemfile:
gem 'fast_xls_to_hash'
And then execute:
$ bundle
Install it yourself as:
$ gem install fast_xls_to_hash
Usage
e.g. in rails
class Example
include FastXlsToHash
FastXlsToHash.with_xls_style = true #optional, default false
dir_of_xls = '/data/test.xls'
hash_of_xls = ParseXls.to_hash(dir_of_xls)
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
The gem is available as open source under the terms of the MIT License.