Forum Discussion
Peter Snabe
Aug 03, 2018Copper Contributor
Save as CSV file (UTF-8) with double quotes - how?
Hi I often need to save data as a CSV file (UTF-8) where all cells are surrounded by double quotes. I cannot find any way to do that in Excel - can it be true? Any idea how to do that?
SergeiBaklan
Aug 03, 2018Diamond Contributor
Hi Peter,
The idea is here http://lenashore.com/2012/04/how-to-add-quotes-to-your-cells-in-excel-automatically/.
In brief, convert your file to CSV, select your range and apply custom \"@\" format, save again.
cantikaliem_
Jun 18, 2021Copper Contributor
If the cells contain number, you can apply custom \"#\" format.
- YellowCylinderAug 02, 2021Copper Contributor
cantikaliem_ Thanks, but that doesn't work if there is a mix of text and numbers.
I figure out this customer formula which will work for all scenarios.
\"#\";\"#\";\"#\";\"@\"This works because you can have multiple custom formula's separated by ; for different data types.
<Format for POSITIVE Numer>;<Format for NEGATIVE Numer>;<Format for ZERO>;<Format for TEXT>- lockjaw8y9Aug 02, 2021Copper Contributor
YellowCylinder It shouldn't be this hard though, do you agree?
- YellowCylinderAug 02, 2021Copper ContributorActually, I just did some testing and ended up not using my new custom format. As far as I can see Excel adds quotes if needed when a cell contains a comma whether you save it as UTF-8 or normal CSV, this is the latest Excel 2016. For my use case that is fine, although I can understand why someone people would want it fully on or fully off.