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

Get index with select-columns #90

Closed
lucasemmoreira opened this issue Jun 29, 2020 · 1 comment
Closed

Get index with select-columns #90

lucasemmoreira opened this issue Jun 29, 2020 · 1 comment

Comments

@lucasemmoreira
Copy link

Hi there! Very nice lib!

Quick question: I would like to know if it is possible to get the index value with other column values. For example:


(->> (load-workbook "spreadsheet.xlsx")
     (select-sheet "Price List")
     (select-columns {:Index? :A :name, :B :price}))

;=> [{:Index? 0 :name "Foo Widget", :price 100}, {:Index? 1 :name "Bar Widget", :price 200}]

Where :Index? would be a key to reference it.

I tried with :Index with no luck.

Thx!

@mjul
Copy link
Owner

mjul commented Jun 30, 2020

If you look at the code for select-columns and project-cell you will see that the index is discarded after getting the name. Returning it would be quite straightforward if you write a new select-columns-with-index function in your client application from the few lines of code in these two functions.

@mjul mjul closed this as completed Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants