to disable any pre-existing default settings, so you can start from a clean-slate.
This is the default behavior, as explained in The Basics.
Similar, but strings. Also explained in The Basics.
Don't forget to start with :none.
:none
With :key_mapping you can completely or partially re-map your header keys.
:key_mapping
Maps keys from -> to, and can map headers to nil, so they can be omitted from the result hashes.
nil
The key_mapping_spec.rb has some examples on how to use this.
key_mapping_spec.rb
You can always define your own custom Procs.
camelcase_headers = Proc.new {|headers| headers.map{|x| x.strip.downcase.gsub(/(\s|\-)+/,'_').split('_').map(&:capitalize).join } } options = { header_transformations: [:none, camelcase_headers ] } data = SmarterCSV.process('/tmp/test.csv', options) => [{"Category"=>"Red", "FirstName"=>"John", "Age"=>"35"}]
There was an error while loading. Please reload this page.