# Can you save multiple tables in a single csv file?

**URL:** https://discourse.processing.org/t/can-you-save-multiple-tables-in-a-single-csv-file/21175
**Category:** Coding Questions
**Created:** [May 22, 2020, 6:57pm UTC](https://discourse.processing.org/t/can-you-save-multiple-tables-in-a-single-csv-file/21175 "2020-05-22T18:57:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![abdullahmq](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@abdullahmq](https://discourse.processing.org/u/abdullahmq)
#### Post date: [May 22, 2020, 6:57pm UTC](https://discourse.processing.org/t/can-you-save-multiple-tables-in-a-single-csv-file/21175/1 "2020-05-22T18:57:47Z")

</div>

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)

I am trying to add and save multiples tables in a single CSV file, I have a car class and every car class inherits its own table but when I stop the program and check my CSV file out, only the table of car 3 appears out of 4 cars …Is it because I add the third car later in the program after 20 seconds,  
Regards

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [May 22, 2020, 10:32pm UTC](https://discourse.processing.org/t/can-you-save-multiple-tables-in-a-single-csv-file/21175/2 "2020-05-22T22:32:15Z")

</div>

Hi,

You have two options :

- I assume `Car` is a class. Then you can declare a [static](https://processing.org/reference/static.html) attribute being a [Table](https://processing.org/reference/Table.html) object holding all the information of you cars.  
Then you can just keep adding columns with ` addColumn()`

- The second solution is to save a CSV file per instances of the class `Car`. It means that each instance is going to have a `Table` class as attribute. In order to save the table with different names for your cars, you can have an `id` for each instance (`saveTable(car_table, "car_" + this.id);`)

---

<div class="post-metadata">

### Author: ![abdullahmq](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@abdullahmq](https://discourse.processing.org/u/abdullahmq)
#### Post date: [May 22, 2020, 10:52pm UTC](https://discourse.processing.org/t/can-you-save-multiple-tables-in-a-single-csv-file/21175/3 "2020-05-22T22:52:09Z")

</div>

Thanks a bunch, I actually thought of the first way and it works.  
Thanks a lot.
