# Where to put csv files in Processing 3?

**URL:** <https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753>\
**Category:** Coding Questions\
**Created:** [April 29, 2019, 11:51am UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753 "2019-04-29T11:51:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 11:51am UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/1 "2019-04-29T11:51:56Z")

</div>

Hello I am new to Processing. I want to parse a csv file but it does not get it.  
Can you help me please?  
Thanks  
My code is 🙂

```auto
Table table;

void setup() {
  
  table = loadTable("C:/Users/Seyfi/Desktop/processing-3.5.3/mammals.csv", "header, csv");

  println(table.getRowCount() + " total rows in table"); 

  for (TableRow row : table.rows()) {
    
    int id = row.getInt("id");
    String species = row.getString("species");
    String name = row.getString("name");
    
    println(name + " (" + species + ") has an ID of " + id);
  }
  
}

```

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 11:54am UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/2 "2019-04-29T11:54:26Z")

</div>

> C:/Users/Seyfi/Desktop/processing-3.5.3/mammals.csv does not exist or could not be read  
> NullPointerException

This is the error I get

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 29, 2019, 12:17pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/3 "2019-04-29T12:17:04Z")

</div>

the processing way is to make under the sketch dir  
a subdir /data/ where you have files like

- fonts
- image
- data
- saved image/ pdf/ files( string / csv / json ) …  
so please start with

```auto
String infile = "data/mammals.csv", outfile = "data/backup.csv";
table = loadTable(infile, "header, csv");

```

only this way you keep your data with the project and are mostly independent from OS the project is run from later.

* * *

also the install directory  
processing-3.5.3  
is a bad place for user data.

possibly you have a other problem,  
where is your sketch directory?  
/ File / Preferences /  
Sketchbook location:  
???

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 12:30pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/4 "2019-04-29T12:30:57Z")

</div>

> C:\Users\Seyfi\Desktop\processing-3.5.3\modes\java\application

This is where the sketch file is under. Is it fine?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 29, 2019, 12:45pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/5 "2019-04-29T12:45:01Z")

</div>

no, i would call that a system directory  
for the Processing 3.5.3

and also that that is under Desktop ( not totally bad, ) shows that you might not know how to handle disk and files under windows?

again, did you set that sketch path in the preferences?

> Processing IDE / File / Preferences / Sketchbook location:

a windows way would be

```auto
C:\Users\Seyfi\Documents\projects\processing\

```

( make the dirs projects\processing\ first )

later when you use

> Processing IDE / File / Sketchbook

that directory opens and show your sketches  
my\_sketch\_1 ( click for open )  
( contains: my\_sketch\_1/mysketch\_1.pde )

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 12:54pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/6 "2019-04-29T12:54:54Z")

</div>

> [@kll](#):
>
> IDE / File / Sketchbook

I dont know how to set sketch path, any reference can you recommend me?  
I created a c:\Users\Seyfi\Documents\projects\processing\ folder\first , but dont know the rest .  
Thanks

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 29, 2019, 12:57pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/7 "2019-04-29T12:57:24Z")

</div>

that is menu operation  
[File]  
…[Preferences]

 ![SNAG-0097](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4cd7eb55a782ada1b24047a62bb96ac46a32960b.jpeg)

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 2:01pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/8 "2019-04-29T14:01:33Z")

</div>

Thank you so much for your help ad time 🙂

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 2:08pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/9 "2019-04-29T14:08:50Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5d460d965ecbd3dd07c3939093bbd85bc7dac83b.png)  
Where should I put my csv file here?  
Thanks

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 29, 2019, 2:12pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/10 "2019-04-29T14:12:51Z")

</div>

no, first save your code using  
/ File / Save As /  
so we can see that project in above directory

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 2:19pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/12 "2019-04-29T14:19:06Z")

</div>

I really thank you 🙂

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 29, 2019, 2:19pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/13 "2019-04-29T14:19:31Z")

</div>

/TableS contains TableS.pde ?

down there you create /data/

> /TableS/data/

and copy csv file into

> /TableS/data/mammal.csv

* * *

and not forget to declare

```auto
String infile = "data/mammals.csv";

```

---

<div class="post-metadata">

**Author:** ![Seyfi](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Post date:** [April 29, 2019, 2:33pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/14 "2019-04-29T14:33:32Z")

</div>

Thanks 🙂 I really appreciate your help

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 30, 2019, 2:44pm UTC](https://discourse.processing.org/t/where-to-put-csv-files-in-processing-3/10753/15 "2019-04-30T14:44:23Z")

</div>

4 posts were split to a new topic: [Csv does not exist or could not be read NullPointerException](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-nullpointerexception/10785)
