# Agents coding work but need add on two variable data

**URL:** https://discourse.processing.org/t/agents-coding-work-but-need-add-on-two-variable-data/234
**Category:** Coding Questions
**Created:** [May 22, 2018, 12:34am UTC](https://discourse.processing.org/t/agents-coding-work-but-need-add-on-two-variable-data/234 "2018-05-22T00:34:42Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [May 22, 2018, 5:41am UTC](https://discourse.processing.org/t/agents-coding-work-but-need-add-on-two-variable-data/234/8 "2018-05-22T05:41:22Z")

</div>

So far so good. Now, you probably see some output, right? Something like:

```auto
46.383,62.939,
39.73,6.828,
...

```

Not this exact output, of course… but the contents of your CSV file. A bunch of numbers, separated by commas.

So, as I have said, the next step is to use `split()`. If you took the time to find the Reference page for this function, you would already have all the information you need.

[https://processing.org/reference/split\_.html](https://processing.org/reference/split_.html)

Again, try to understand what the `split()` function does, and then attempt to use it in your own code yourself. The goal here is to get just ONE number per line!

```auto
void setup() {
  size(600, 600);
  String [] data; 

  data = loadStrings( "Spellman.csv" );
  println("there are " + data.length + " data");
  for (int i = 0; i < data.length; i++) {
    // Tell which line we are looking at now.
    println( "Now looking at line # " + i + ", which is " + data[i] );
    // Parse this line... somehow...
    float[] numbers_on_this_line = ???; // Try to fill in the rest of this line.
    // Show every number we found on this line.
    for( int j=0; j < numbers_on_this_line.length; j++){ println( "" + i + ", " + j + " => " + numbers_on_this_line[j] );}
  }
}

```

---

_[View the full topic](https://discourse.processing.org/t/agents-coding-work-but-need-add-on-two-variable-data/234)._
