★ wanayoo — archive 1999 https://github.com/pythonicrubyist/creek/issues/82Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get header as Key name? #82

Closed
leoplct opened this issue Jun 28, 2019 · 2 comments
Closed

How to get header as Key name? #82

leoplct opened this issue Jun 28, 2019 · 2 comments

Comments

@leoplct
Copy link

@leoplct leoplct commented Jun 28, 2019

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
Copy link

@axlwild axlwild commented Jun 29, 2019

You can make a dictionary with the equivalence

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

@pythonicrubyist
Copy link
Owner

@pythonicrubyist pythonicrubyist commented Dec 30, 2019

Good point. I have added it to the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.