pythonicrubyist / creek

Ruby library for parsing large Excel files.
http://rubygems.org/gems/creek
MIT License
386 stars 109 forks source link

How to get header as Key name? #82

Closed leoplct closed 4 years ago

leoplct commented 5 years ago

The first row of my excel has the header. How can I get the header name instead of "A", "B" etc.?

{"A"=>"DATE, "B"=>"TEXT", "C"=>"TEXT", "D"=>"TEXT"}

-->

{"Start date"=>"DATE, "First name"=>"TEXT", "Last name"=>"TEXT", "Address"=>"TEXT"}

Would be great to parse header giving a regex expression. Just like Roo gem

axlwild commented 5 years ago

You can make a dictionary with the equivalence

equ = {"StartDate" => "A"} and access with sheet[equ["StartDate"]]

pythonicrubyist commented 4 years ago

Good point. I have added it to the backlog.