# Savetable with P5

**URL:** <https://discourse.processing.org/t/savetable-with-p5/17475>\
**Category:** p5.js\
**Created:** [January 31, 2020, 9:44am UTC](https://discourse.processing.org/t/savetable-with-p5/17475 "2020-01-31T09:44:41Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 31, 2020, 5:02pm UTC](https://discourse.processing.org/t/savetable-with-p5/17475/3 "2020-01-31T17:02:18Z")

</div>

Hello,

I used this example:

[https://p5js.org/reference/#/p5/saveTable](https://p5js.org/reference/#/p5/saveTable)

I edited it:

```auto
let table;

 function setup() {
 table = new p5.Table();

// table.addColumn('id');
 //table.addColumn('species');
 //table.addColumn('name');

 //let newRow = table.addRow();
// newRow.setNum('id', table.getRowCount() - 1);
 //newRow.setString('species', 'Panthera leo');
// newRow.setString('name', 'Lion');

 // To save, un-comment next line then click 'run'
  saveTable(table, 'new.csv');
 }

 // Saves the following to a file called 'new.csv':
 // id,species,name
 // 0,Panthera leo,Lion

```

It saves a csv file.

This works as well:

```auto
 saveTable(table, 'new', 'csv');

```

Google Chrome was used along with [https://editor.p5js.org/](https://editor.p5js.org/)

---

_[View the full topic](https://discourse.processing.org/t/savetable-with-p5/17475)._
