# How to write many DataFrames in a single CSV file?

**URL:** <https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818>\
**Category:** General Usage\
**Created:** [April 5, 2019, 8:56pm UTC](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818 "2019-04-05T20:56:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steph\_de\_paris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steph_de_paris/32/7780_2.png) [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Post date:** [April 5, 2019, 8:56pm UTC](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818/1 "2019-04-05T20:56:39Z")

</div>

Hello,

Is it possible to write many DataFrames (with identical structure) in a single CSV file by using for example CSV.write and a loop ?

Thank you very much for your advice !

Moreover, how to write 2 DataFrames with diffrent structure in a single CSV file without using a shell command such as cat 1.csv 2.csv \> res.csv (for example) ?

Thanks again !

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [April 5, 2019, 9:26pm UTC](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818/2 "2019-04-05T21:26:05Z")

</div>

`CSV.write` form CSV.jl has `append` keyword argument that is designed to handle this case.

---

<div class="post-metadata">

**Author:** ![steph\_de\_paris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steph_de_paris/32/7780_2.png) [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Post date:** [April 9, 2019, 12:36pm UTC](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818/3 "2019-04-09T12:36:34Z")

</div>

Thanks ! It works ! 😀
