DiegoZoracKy / convert-excel-to-json

Convert Excel to JSON, mapping sheet columns to object keys.
MIT License
287 stars 91 forks source link

how to change sheet name #48

Closed aboodrazeq closed 3 years ago

aboodrazeq commented 3 years ago

everything ok I read all data and the header but I want to remove the sheet or change the name of it thank you

DiegoZoracKy commented 3 years ago

Hi @aboodrazeq maybe this config is what you are looking for:

https://github.com/DiegoZoracKy/convert-excel-to-json#only-to-specific-sheets

Sanotsu commented 3 years ago

Maybe like a sheet named "sheet1", after convert to JSON, the name changed to "newSheet"? Thx.

Marcosmaliki commented 3 years ago

I need this too, sheet name can be dynamic

Marcosmaliki commented 3 years ago

Never mind. We can use Object.keys(result) to get the sheet name then use it to filter the response like result[Object.keys(result)[0]]

DiegoZoracKy commented 3 years ago

I believe that the way @Marcosmaliki brought would be the best one to go. Although we can develop this as a new feature, it's so simple to be done on a post processing snippet of code that maybe isn't worth to think of it as a new feature. I'm going to close this issue but if someone wants to get back to this conversation we can reopen it.