# Export CSV fails to properly quote all fields

**URL:** <https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121>\
**Category:** General Q&A\
**Created:** [April 13, 2017, 12:20pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121 "2017-04-13T12:20:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tech4him](https://community.easymorph.com/user_avatar/community.easymorph.com/tech4him/32/776_2.png) [@tech4him](https://community.easymorph.com/u/tech4him)\
**Post date:** [April 13, 2017, 12:20pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/1 "2017-04-13T12:20:14Z")

</div>

I'm wondering if anyone else is experiencing this issue.

I have a final step in a project that exports a table to a csv using the Export CSV transformation. Unfortunately, fields with spaces in the values are not being quoted. I am not able to use the "quote everything" option as the numeric fields need to remain numeric without quotes.

Am I missing an option to define the field types and thus quoting of the exported CSV or is this a bug?

Thanks in advance,

T

---

<div class="post-metadata">

**Author:** ![andrew.rybka](https://community.easymorph.com/user_avatar/community.easymorph.com/andrew.rybka/32/13_2.png) [@andrew.rybka](https://community.easymorph.com/u/andrew.rybka)\
**Post date:** [April 13, 2017, 1:11pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/2 "2017-04-13T13:11:58Z")

</div>

@tech4him,

most commonly used [CSV specification](https://tools.ietf.org/html/rfc4180#section-2) doesn't require fields with spaces to quoted.

Can you please share with us why do you need such values to be quoted?

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [April 13, 2017, 1:41pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/3 "2017-04-13T13:41:15Z")

</div>

You can rename fields and wrap field names in quotes using "Rename columns" transformation. E.g. rename [Start Date] into ["Start Date"].

---

<div class="post-metadata">

**Author:** ![tech4him](https://community.easymorph.com/user_avatar/community.easymorph.com/tech4him/32/776_2.png) [@tech4him](https://community.easymorph.com/u/tech4him)\
**Post date:** [April 13, 2017, 1:49pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/4 "2017-04-13T13:49:52Z")

</div>

Wow! Thanks dgudkov and andrew.rybka. New to this tool and community having left the world of SSIS/DTS. Appreciative for the help.

Andrew, the need is actually in order to import into a system that is having trouble importing with long strings of text NOT being quoted. We are working with that solution provider who is asking a very similar question to yours, in reverse. 🙂 I'm just trying to get this working while the solution provider gets it sorted.

dgudkov, while the field names are fine, it is the field values where we run into a problem. Good point though, I could add transformations which enclose values in quotes for affected fields. Interesting suggestion. Thank-you.

I guess I can determine that EasyMorph is determining when to add quotes to values in the Export CSV transformation based upon field values rather than a field data type. Would that be correct? It certainly explains the export results I've seen.

Just a feature thought then, perhaps on the Export to CSV transformation there is the ability to set quoting at the column/field level, ie. a check box next to each column name or selecting columns that should be quoted.

Thanks for the assistance!

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [April 13, 2017, 9:24pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/5 "2017-04-13T21:24:19Z")

</div>

Thank you for the suggestion. It's duly noted.

Yes, wrapping values with spaces into quotes can be done using expressions on per column basis with the help of [char()](http://help.easymorph.com/doku.php?id=syntax:functions:char) or [quote()](http://help.easymorph.com/doku.php?id=syntax:functions:quote) function. Although, note that per RFC4180 double quotes are escaped with another set of double quotes which might be not exactly what you're looking for.

---

<div class="post-metadata">

**Author:** ![tech4him](https://community.easymorph.com/user_avatar/community.easymorph.com/tech4him/32/776_2.png) [@tech4him](https://community.easymorph.com/u/tech4him)\
**Post date:** [April 13, 2017, 9:59pm UTC](https://community.easymorph.com/t/export-csv-fails-to-properly-quote-all-fields/121/6 "2017-04-13T21:59:44Z")

</div>

Agreed per RFC although I'm happy finding a workaround for now. 🙂 Thanks again.

BTW, great toolset in EasyMorph. Being familiar with ETL process and tools, I had my first usable project completed in about an hour without having read the documentation. That is a testament to the good thought put into the tool and the UX. Now, I'm going through the documentation which is additionally helpful.
