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

alwaysQuote option doesn't quote null fields #60

Open
deakinhead opened this issue Jan 6, 2021 · 5 comments
Open

alwaysQuote option doesn't quote null fields #60

deakinhead opened this issue Jan 6, 2021 · 5 comments

Comments

@deakinhead
Copy link

Hi. I'm using csv writer to integrate with a warehouse and they require that all values, including null values, in the csv be double quoted. I set the alwaysQuote option to true, but it looks like null values still get output as

,,,,,

rather than

,"","","","",

Would it be possible to add a new option to double quote null values or to update the existing option so that it works that way?

@ryu1kn
Copy link
Owner

ryu1kn commented Jan 6, 2021

Hi @deakinhead , thanks for the suggestion. I want to avoid making a breaking change at this stage; so probably need to introduce a new flag. Naming would be a struggle. Wish alwaysQuote gave quotes even for empty fields...

@ryu1kn
Copy link
Owner

ryu1kn commented Jan 6, 2021

ref #38

@ryu1kn
Copy link
Owner

ryu1kn commented Jan 6, 2021

quoteEmptyFields ?

@deakinhead
Copy link
Author

@ryu1kn Thanks for the quick response.
quoteEmptyFields sounds good to me.

How long do you think it would take to add?

@blowfishlol
Copy link

blowfishlol commented Apr 4, 2023

Hi @ryu1kn , i have opened a PR to add this param into the writers :)

#97

This makes the writer accept quoteEmptyFields param, that makes nullish (null/undefined) values to be written with empty double-quote "" on the CSV generation.

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

3 participants