Closed qiusli closed 6 years ago
after taking a closer look at the generated file and compare with another csv file which was generated from a Java project I found that the biggest difference is the data feed to microsoft excel, the one generated from json2csv has double quotes around each value while the original data from the other csv does not have double quotes around each of its value, maybe this could cause excel to translate data passed in in a different way.
after converting boolean value to its string version and set excelString attribute to true solved the problem, but still if the value is boolean, it got translated to all uppercase in excel.
I just tested this and it seems to work fine for me.
The casing is never changed.true
and false
are always lowercase
Using the quote: ''
option you can get a CSV without quotes around the cells.
Similarly, using the excelString: true
option.
Neither of those options would affect the boolean values since they are not strings.
It might be that excel just display boolean values in uppercase, in which case is an issue with excel and not with this library.
Please feel free to reopen if I misunderstood and this is still an issue.
If the values of a particular column are of type boolean, the generated file will have that column with uppercase TRUE or FALSE. I tried to pass lowercase string 'true' or 'false' but still they got converted to uppercase. Any suggestions? Thanks,