-
Notifications
You must be signed in to change notification settings - Fork 92
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 convert empty space cell's to null values #9
Comments
Can you post here the full config (header, columnToKey, etc.) you are passing in to the lib? |
Hi @kgrvamsi, Did you solve your issue? Can we close this? |
@DiegoZoracKy i'm really sorry i didn't looked into this issue ...my bad but here is the config i use as part of the conversion.
I'm expecting something like this
|
No problem @kgrvamsi. Would mind explaining your use case? Why do you need the property with a null value? |
the excel sheet's i convert at times i see that even if there is a space it would result me with a undefined value and if there is no value in the cell that that value won't populate in the json array which is good and simplifies my work more on to defect for the right key(A,B,C,D....) |
Thanks for the awesome library @DiegoZoracKy . I believe I have a similar use case to @kgrvamsi Given the following spreadsheet Current result:
Desired result:
It would be nice to have an option to choose whether to return "property: null" or "no property" for empty cells. The use case is for creating objects that need to have values or nulls for all the properties in order to be complete. |
Hi @micdemarco and @kgrvamsi (again),
The following line is where a new choice has to be made. The ".v" can be undefined however ".z" will have a value on these cases:
Tell me if some of you would like to work on this issue, so I can provide further guidance on it. |
@DiegoZoracKy sure, I'll be happy to make the changes |
Great! If you need more info on this specific case or just about the internals of this lib you can keep posting here and I'll help you. |
Hi @DiegoZoracKy ! |
@harsh07bharvada some work was done in this pr #39 |
Hi @micdemarco and @harsh07bharvada, I'm sorry for the delay. I'm really facing a huge lack of time currently. @micdemarco the PR is merged now and thanks for working on it! @harsh07bharvada can you try to use this new version, see if that works well for your case and return here with a feedback? |
Hi @DiegoZoracKy i also facing same issue. My case is i want to insert excel data into database. in this case, Above configuration does not returns null values. But i need that null columns also. suggest me how to handle this. |
Hi @intermx-krishnan, the README.md hasn't been updated yet with the new feature brought by @micdemarco and released on version 1.7.0. You just have to define https://github.com/DiegoZoracKy/convert-excel-to-json/pull/39/files |
@intermx-krishnan @DiegoZoracKy Yes, correct, i've added a pr to update the README |
How can i keep the empty spaces with cells to match the header data.(is there a way to define empty space as null or none value when converted to json)
Example: header cells :14
Cells: 11(3 cells are empty space cells)
The text was updated successfully, but these errors were encountered: