# Drawing a radar with CSV file reading error

**URL:** <https://discourse.processing.org/t/drawing-a-radar-with-csv-file-reading-error/2441>\
**Category:** Coding Questions\
**Created:** [August 7, 2018, 9:23am UTC](https://discourse.processing.org/t/drawing-a-radar-with-csv-file-reading-error/2441 "2018-08-07T09:23:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Charlie](https://discourse.processing.org/u/Charlie)\
**Post date:** [August 7, 2018, 9:23am UTC](https://discourse.processing.org/t/drawing-a-radar-with-csv-file-reading-error/2441/1 "2018-08-07T09:23:39Z")

</div>

Hi!

Nowadays I’m trying to draw radar with csv file. csv file format is like

(date, x, y)

**example** :

181743,78,152  
181744,123,512  
181745,126,341  
181746,153,153  
181747,173,175

and so on

**This is my code**

> float a;  
> float b;  
> float c;  
> float d;  
> float time;
> 
> import processing.serial.\*;  
> void setup() {  
> size(800,500);  
> frameRate(0.5);  
> Table table = loadTable(“example.cvs”, “header”);  
> TableRow t = table.getRow(0);  
> TableRow pre = table.getRow(1);  
> TableRow now = table.getRow(2);  
> float time = t.getFloat(0);  
> float a = pre.getFloat(1);  
> float b = pre.getFloat(2);  
> float c = now.getFloat(1);  
> float d = now.getFloat(2);  
> println(a);  
> println(c);
> 
> }
> 
> void draw() {  
> translate(width/2, height/2);  
> drawradar();  
> drawtarget();  
> }
> 
> void drawtarget() {  
> ellipse(a, b, 100, 100);  
> ellipse(c, d, 100, 100);  
> line(a,b,c,d);  
> println(time);
> 
> }
> 
> void drawradar() {  
> background(0);  
> noFill();  
> strokeWeight(2);  
> stroke(98, 245, 31);  
> ellipse(0, 0, 900, 900);  
> ellipse(0, 0, 700, 700);  
> ellipse(0, 0, 500, 500);  
> ellipse(0, 0, 300, 300);  
> ellipse(0, 0, 100, 100);  
> strokeWeight(1);  
> line(-400, -400, 400, 400);  
> line(400, -400, -400, 400);  
> line(0, -400, 0, 400);  
> line(-400, 0, 400, 0);  
> textAlign(RIGHT);  
> text(“10cm”, 50, 0);  
> text(“20cm”, 150, 0);  
> text(“30cm”, 250, 0);  
> text(“40cm”, 350, 0);  
> text(“50cm”, 450, 0);  
> }

**This is my error**

NullpointerException

While I am working with my project and I thought it has no problem, but I encountered some error.  
Please give me some advice to solve this problem…

---

<div class="post-metadata">

**Author:** ![MxFxM](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@MxFxM](https://discourse.processing.org/u/MxFxM)\
**Post date:** [August 7, 2018, 11:15am UTC](https://discourse.processing.org/t/drawing-a-radar-with-csv-file-reading-error/2441/2 "2018-08-07T11:15:56Z")

</div>

csv should be seperated by ; instead of ,  
I didn’t look further but that might be a problem.

---

<div class="post-metadata">

**Author:** ![EnhancedLoop7](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/enhancedloop7/32/1040_2.png) [@EnhancedLoop7](https://discourse.processing.org/u/EnhancedLoop7)\
**Post date:** [August 7, 2018, 3:42pm UTC](https://discourse.processing.org/t/drawing-a-radar-with-csv-file-reading-error/2441/3 "2018-08-07T15:42:18Z")

</div>

When it comes to NullPointer Exceptions, that’s exactly what it is: a null pointer exception. That means that your code is trying to look for something, that in essence, doesn’t really exist. The only main place that you’re loading in a file is in the line that says:

```auto
Table table = loadTable(“example.cvs”, “header”);

```

It says “example.cvs” don’t you mean “example.csv”?

That’s first. And maybe if it **still** doesn’t work, you can try adding in the full path to that file?

There could be something else causing this, but I highly doubt it. Hopefully this helps,

EnhancedLoop7
