adds optional parameter quoteEmptyFields#97
adds optional parameter quoteEmptyFields#97blowfishlol wants to merge 1 commit intoryu1kn:masterfrom
Conversation
|
+1 this would be very useful Full disclosure: The author of the MR and I work at the same company. |
|
@ryu1kn Is there anything else that should be done for this MR? |
|
+1 this would be indeed useful |
|
+1. I would like have this PR merged and released soon :-) |
|
+1 I'd love to keep using this package but I needed this functionality and ultimately couldn't get it here. I'll have to look elsewhere. Love the interface but it's missing important functionality and contributor presence. |
|
Hi @blowfishlol , I’ve forked the CSV Writer project since the original seems abandoned. Your work on the Check it out here: CSV Writer Portable. You’re credited in the commit messages. Thanks for your contribution! Best, |
|
+1 please merge this PR soon! |
1 similar comment
|
+1 please merge this PR soon! |
|
@ryu1kn |
This pull request takes the input stated in issue #60
with this PR,
createObjectCsvWriterandcreateArrayCsvWriteraccepts the parameterquoteEmptyFields, and this will any cause empty (null/undefined) values to be given an empty double quote ("")The reason we needed this is that our company is working on the finance sector and one of the specification for the generated CSV files is for the nullish fields to be given an empty quote (""), and this PR makes it possible to configure the CSV writer to write nullish values as ("")
So
quoteEmptyFieldstogether with thealwaysQuoteparam, with the input of:["VALUE_A, "VALUE_B", undefined, null]Will generate an output:
"VALUE_A","VALUE_B","",""\n