# Writing DataFrame with no quotemarks

**URL:** <https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599>\
**Category:** General Usage\
**Created:** [July 2, 2017, 6:05pm UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599 "2017-07-02T18:05:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 2, 2017, 6:05pm UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/1 "2017-07-02T18:05:44Z")

</div>

Function `writetable` requires a quotemark character. Is there a direct way to write a DataFrame to CSV file without any quotemarks?

---

<div class="post-metadata">

**Author:** ![abieler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abieler/32/2693_2.png) [@abieler](https://discourse.julialang.org/u/abieler)\
**Post date:** [July 3, 2017, 9:08am UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/2 "2017-07-03T09:08:26Z")

</div>

I had the same question a while ago and you can follow the discussion here:

[https://github.com/JuliaStats/DataFrames.jl/issues/811#issuecomment-108913671](https://github.com/JuliaStats/DataFrames.jl/issues/811#issuecomment-108913671)

So to my knowledge this is not supported in `DataFrames`, but I never actually followed this up on `CSV.jl`

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [July 3, 2017, 10:12am UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/3 "2017-07-03T10:12:36Z")

</div>

I’m adding this option to CSVFiles.jl right [now](https://github.com/davidanthoff/CSVFiles.jl/pull/2). Once that PR is merged and a new version is tagged, this should work:

```julia
using FileIO, CSVFiles

df = ...
save("file.csv", df, quotechar=nothing)

```

Or you can use the pipe style

```julia
df |> save("file.csv", quotechar=nothing)

```

`df` can be any [iterable table](https://github.com/davidanthoff/IterableTables.jl), i.e. not just a `DataFrame`.

I’ll have to write some documentation for the whole [FileIO.jl](https://github.com/JuliaIO/FileIO.jl) integration that we have now for iterable tables (for example, the same pattern also works for feather files via [FeatherFiles.jl](https://github.com/davidanthoff/FeatherFiles.jl)) soon.

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 10:33am UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/4 "2017-07-03T10:33:43Z")

</div>

Wow, that was quick! Thanks a lot, David.

I’m a beginner Julia user, so this may not be a good idea, but what about making `quotemark` a parameter of nullable type instead of adding an extra `quote_char` parameter?

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 11:14am UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/5 "2017-07-03T11:14:34Z")

</div>

Nevermind. I just looked at nullable types and the notation would be too cumbersome for mainstream usage:  
`quotemark = Nullable{Char}('"')`

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [July 3, 2017, 11:50am UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/6 "2017-07-03T11:50:28Z")

</div>

> [@pauljurczak](#):
>
> I’m a beginner Julia user, so this may not be a good idea, but what about making `quotemark` a parameter of nullable type instead of adding an extra `quote_char` parameter?

I’m using a `Nullable` in the internal implementation, but using them for he user facing API is less nice because you would have to construct a `Nullable` whenever you want to just pass in a character. Essentially the user facing API is now using `Union{Char,Void}`, which should make for the easiest API. [Had this post composed before lunch and see that you figured this out yourself in the meantime!]

Not sure what you mean by `quotemark`, there is no parameter with that name anywhere.

BUT, I took another look at the names for the optional parameters, and I’m changing `quote_char` to `quotechar`, that makes it consistent with CSV.jl and TextParse.jl. I’v edited my post from above accordingly.

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 12:31pm UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/7 "2017-07-03T12:31:38Z")

</div>

> [@davidanthoff](#):
>
> Not sure what you mean by quotemark, there is no parameter with that name anywhere.

I just used it in my code. Here is the documentation snippet:

```julia-auto
writetable(filename, df, [keyword options])
...
quotemark::Char – The character used to delimit string fields. Defaults to '"'.

```

There is also a bad example there:

```julia-auto
writetable("output.dat", df, quotemark = '', separator = ',')

```

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 12:49pm UTC](https://discourse.julialang.org/t/writing-dataframe-with-no-quotemarks/4599/8 "2017-07-03T12:49:29Z")

</div>

Oooops! I meant `DataFrames.writetable` and you meant `save`. My mistake.
