# Csv does not exist or could not be read (application)

**URL:** <https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763>\
**Category:** Coding Questions\
**Created:** [November 17, 2022, 7:36pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763 "2022-11-17T19:36:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 17, 2022, 7:36pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/1 "2022-11-17T19:36:00Z")

</div>

Hi !  
My program is quite simple :

```auto
  Table base = loadTable("base.csv");
  println(base.getRowCount() + " total rows in table");

```

And it works well while running it from Processing.  
The base.csv file is in the data folder (yes, I tried stuff like ‘loadTable(dataPath(“base.csv”))’)  
When I export this program as an application (linux or macOSX), I have this error :

```auto
  base.csv does not exist or could not be read
  java.lang.NullPointerException: Cannot invoke 'processing.data.Table.getRowCount()' because 'base' is null

```

So it seems that the application is unable to find the file. It acts same with Processing 3 or 4.  
Is there something I don’t get about the path ?  
I’ve seet questions with the same error code, but not related to an exported application.

jn

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [November 17, 2022, 11:38pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/2 "2022-11-17T23:38:44Z")

</div>

Hi

Set path inside sketch

```auto
Table base = loadTable("base.csv"); /// set path 
  println(base.getRowCount() + " total rows in table");

```

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 17, 2022, 11:40pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/3 "2022-11-17T23:40:32Z")

</div>

I’m not sure to get what’s different here !  
Or you mean I shoud write the exact parth, like _/home/id/sketches/sketch/data/base.csv_ ?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 18, 2022, 12:01am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/4 "2022-11-18T00:01:46Z")

</div>

When the code is okay, can it be that the file has not been copied in the executable?

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [November 18, 2022, 12:03am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/5 "2022-11-18T00:03:42Z")

</div>

Hi

Maybe this help

> [@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/4):
>
> please open your own TOPIC but read this one first about processing folder / file structure also if you read that already you should know that info about path and filename is essential to this question but code and data NOT, only the Table table; String infile = "data/posit18.csv"; //.. table = loadTable(infile, "header, csv"); but as you show this already even you get your project / file path correct – that is not a csv file!! should be like x,th1,th2,F -0.00099,0.018381,0.009091,-1…

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 18, 2022, 12:04am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/6 "2022-11-18T00:04:35Z")

</div>

There is a copy of the whole data folder (including the .csv file) coming wit the executable, so I guess it’s not it…

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 18, 2022, 12:09am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/7 "2022-11-18T00:09:54Z")

</div>

Well it’s not the issue there, my csv is okay, and it works when I’m not exporting as an executable. I tried a few different path notations, except the absolute path, I’ll see if that works.  
Just now I found an odd way : the csv ins in my pde file as as String wich I save then load…

---

<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:** [November 19, 2022, 1:01pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/9 "2022-11-19T13:01:20Z")

</div>

Hello @Jean-no ,

Exporting and loading a table worked as expected on Ubuntu Linux on my system with Processing for Linux(Intel 64-bit).

> [@Jean-no](#):
>
> Just now I found an odd way : the csv ins in my pde file as as String wich I save then load…

Can you provide a reference or a simplified example?

I am aware of this reference:  
[https://discourse.processing.org/t/use-loadtable-with-variable-like-string-string-string-stringlist/12457/7](https://discourse.processing.org/t/use-loadtable-with-variable-like-string-string-string-stringlist/12457/7)

I have another one somewhere… just can’t find it.

`:)`

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 19, 2022, 1:51pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/10 "2022-11-19T13:51:32Z")

</div>

I’m not sure to understand what you mean (or not sure I explained myself very clearly, as english is not my native tongue). You mean that when you export your sketch as an application it has no difficulties finding the .csv file in the data folder ?

---

<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:** [November 19, 2022, 1:56pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/11 "2022-11-19T13:56:58Z")

</div>

> [@Jean-no](#):
>
> You mean that when you export your sketch as an application it has no difficulties finding the .csv file in the data folder ?

Yes. It was able to export the application and read the csv file in the data folder.

`:)`

---

<div class="post-metadata">

**Author:** ![Jean-no](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jean-no/32/3352_2.png) [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Post date:** [November 19, 2022, 3:32pm UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/12 "2022-11-19T15:32:19Z")

</div>

Ok. So the problem must be in the path or something… But weirdly, it’s the same problem wether I use Ubuntu, MacOS or Raspbian.

---

<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:** [November 20, 2022, 12:44am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763/13 "2022-11-20T00:44:25Z")

</div>

Hello @Jean-no ,

I am running Ubuntu in a VM in Workstation Pro.

Running the exported app works here.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/9/09fd591812d8cf255d71a720107fdb3924cb864b.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/d/c/dc605a395d40ca7245fd17208a163b79b65c981a.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/7/9777771f45800c734a4c53f63737c0f82d8b6d27.png)

`:)`
