<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with addcolumn() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=addcolumn%28%29</link>
      <pubDate>Sun, 08 Aug 2021 18:51:31 +0000</pubDate>
         <description>Tagged with addcolumn() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedaddcolumn%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Can I use f = open('text', 'w') with processing?</title>
      <link>https://forum.processing.org/two/discussion/27767/can-i-use-f-open-text-w-with-processing</link>
      <pubDate>Sun, 15 Apr 2018 04:32:55 +0000</pubDate>
      <dc:creator>netrate</dc:creator>
      <guid isPermaLink="false">27767@/two/discussions</guid>
      <description><![CDATA[<p>I was looking at the writing to a text file using python/processing and noticed that there is something called: "createWriter".  Is this the only way?  I am used to using: 
<code>open("text", "w")</code> 
After several attempts at using "open", I couldn't get it to create the text file BUT, for some reason:
<code>open("text", "r")</code>
seems to work.</p>

<p>Here is my code :
  <code>f = open('text.txt', 'w')
    f.write("hello")
    f.close()
    noLoop()</code></p>

<p>If I have to use CreateWriter, I will, but I was wondering why the "r" works, but the "w" does not?</p>
]]></description>
   </item>
   <item>
      <title>minim: saving buffer samples as csv</title>
      <link>https://forum.processing.org/two/discussion/26821/minim-saving-buffer-samples-as-csv</link>
      <pubDate>Tue, 13 Mar 2018 23:48:29 +0000</pubDate>
      <dc:creator>EmirMore</dc:creator>
      <guid isPermaLink="false">26821@/two/discussions</guid>
      <description><![CDATA[<p>Hi there,</p>

<p>Trying to achieve what seemed simple at first (in my rookie's mind). I want to play a sound, and save first 1024 samples from buffer as csv table.</p>

<p>It's sort of works but saved csv is not accurate, the records are messed up chunks, sometimes not starting at the beginning of the file.</p>

<p>I saved my .wav file in audacity as .csv table to have an accurate reference.</p>

<p>I reckon I need some kind of synchronization between beginning of the <strong>play()</strong> and <strong>for</strong> loop.</p>

<p>Thank you for your help in advance!</p>

<p>here is the code:</p>

<pre><code>import ddf.minim.*;

Minim minim;
AudioPlayer groove;
AudioMetaData meta;
Table table;

void setup()
{

  minim = new Minim(this);
  groove = minim.loadFile("noise.wav", 1024);
  meta = groove.getMetaData();

  table = new Table();
  table.addColumn("id");
  table.addColumn("data");

  //print some sample info
  println(groove.bufferSize());
  println(meta.sampleFrameCount());


  groove.play();

  for (int i=0; i &lt; groove.bufferSize(); i++) {
    TableRow newRow = table.addRow();
    newRow.setInt("id", table.getRowCount() - 1);
    newRow.setFloat("data", groove.mix.get(i));
  }

  saveTable(table, "data/data.csv");
}

void draw() {
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Error With Table: Cannot read property 'toString' of undefined</title>
      <link>https://forum.processing.org/two/discussion/25176/error-with-table-cannot-read-property-tostring-of-undefined</link>
      <pubDate>Fri, 24 Nov 2017 07:54:45 +0000</pubDate>
      <dc:creator>httpwilfred</dc:creator>
      <guid isPermaLink="false">25176@/two/discussions</guid>
      <description><![CDATA[<p>Trying to create a basic decimal ASCII table to be used in some other sketches. It was working fine 2 hours ago but I changed up my input array and suddenly p5 starts throwing errors.</p>

<p>Here's my code:</p>

<pre><code>var characterLibrary = new p5.Table();
var input = [];

function setup() {
    createCanvas(1, 1);
    console.log("program started");               
    input = [" ", "!", "\"", "#", "$", "%", "&amp;", "\'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "&lt;", "=", "&gt;", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~"];
    characterLibrary.addColumn("index");
    characterLibrary.addColumn("character");
    for(var i = 32; i &lt; input.length + 32; i++) {
        var rowIndex = i-32;
        characterLibrary.addRow();
        characterLibrary.setNum(rowIndex, "index", i);
        characterLibrary.setString(rowIndex, "character", input[i]);
    }
    console.log(millis());
    saveTable(characterLibrary, "characterLibrary.csv");
}
</code></pre>

<p>Error I get in chrome:</p>

<pre><code>Uncaught TypeError: Cannot read property 'toString' of undefined
    at p5.TableRow.setString (VM344 p5.js:59736)
    at p5.Table.setString (VM344 p5.js:59407)
    at setup (VM347 generateCharacterLibrary.js:20)
    at p5.&lt;anonymous&gt; (VM344 p5.js:44882)
    at p5.&lt;anonymous&gt; (VM344 p5.js:44810)
    at new p5 (VM344 p5.js:45103)
    at _globalInit (VM344 p5.js:46862)
</code></pre>

<p>I've also gotten this error earlier in the day, but went away when I restarted my computer:</p>

<pre><code>VM423 p5.js:59391 Uncaught TypeError: Cannot read property 'setNum' of undefined
    at p5.Table.setNum (VM423 p5.js:59391)
    at setup (VM426 generateCharacterLibrary.js:21)
    at p5.&lt;anonymous&gt; (VM423 p5.js:44882)
    at p5.&lt;anonymous&gt; (VM423 p5.js:44810)
    at new p5 (VM423 p5.js:45103)
    at _globalInit (VM423 p5.js:46862)
</code></pre>

<p>Things I've tried:</p>

<p>-console logged all vars, they seem to be performing as expected</p>

<p>-quadruple checked syntax</p>

<p>-tried using simple input array to see if it was a problem with one of my strings</p>

<p><code>input = ["A", "B", "C"];</code></p>

<p>-restarted code editor</p>

<p>-tried running html outside code editor</p>

<p>-tried firefox, opera</p>

<p>-restart computer</p>

<p>-switched from p5.js lib on github to build from processing.org</p>

<p>Is something wrong with my code? Or is something up with p5?</p>
]]></description>
   </item>
   <item>
      <title>How can I specify (increase) the maximum row count in a table in processing</title>
      <link>https://forum.processing.org/two/discussion/24993/how-can-i-specify-increase-the-maximum-row-count-in-a-table-in-processing</link>
      <pubDate>Tue, 14 Nov 2017 00:40:34 +0000</pubDate>
      <dc:creator>Sparky</dc:creator>
      <guid isPermaLink="false">24993@/two/discussions</guid>
      <description><![CDATA[<p>I am using processing.org to collect a large amount of data and put it in a table. I then write this table to a CSV file. The code I have works great until I get around 1 million rows in my table. After that I get messages in the console saying:</p>

<p><strong>"Note: setting maximum row count to 1,310,720 (resize took 1,654 ms)".</strong></p>

<p>This makes my program take ages to run. I added a <strong>setRowCount();</strong> line to my code but this did not remedy my issue, it gave me an empty table. Here is my code with the added line:</p>

<pre lang="processing">
// stuff is a large array of values &gt; 1 million
t = new Table();
t.setRowCount(10000000);  
t.addColumn("Stuff"); 
for( int i = o; i &lt; stuff.length; i++) 
    {  
    TableRow newRow = t.addRow(); 
    newRow.setFloat("Stuff", stuff[i]);
    } 
saveTable(t, "data.csv");
</pre>
]]></description>
   </item>
   <item>
      <title>Datalogging of data sent from Arduino to PC using Bluetooth</title>
      <link>https://forum.processing.org/two/discussion/24459/datalogging-of-data-sent-from-arduino-to-pc-using-bluetooth</link>
      <pubDate>Sun, 08 Oct 2017 21:46:17 +0000</pubDate>
      <dc:creator>ElizabethLeriche</dc:creator>
      <guid isPermaLink="false">24459@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I have an arduino reading six input values sending them over bluetooth to a PC receiving the data on COM4. The data is coded in the arduino code to have commas seperating the sensor data. I am looking to be able to read the data from the bluetooth and log it in an excel file simultaneously showing the time, date and then the six data values in seperate columns. Can someone help me with this? A code I have started so far is below.</p>

<pre><code>    //import the required libraries
    import processing.serial.*;

    Serial mySerial;
    Table table;
    String filename;

    void setup()
    {
      //set mySerial to listen on COM port 10 at 9600 baud
      mySerial = new Serial(this, "COM4", 9600);

      table = new Table();
      //add a column header "Data" for the collected data
      //add a column header "Time" and "Date" for a timestamp to each data entry
      table.addColumn("Date");
      table.addColumn("Time");
      table.addColumn("Occupancy");
      table.addColumn("Lights");
      table.addColumn("Door");
      table.addColumn("Voltage");
      table.addColumn("WindMPH");
      table.addColumn("Temperature");

    }

    void draw()
    {
      //variables called each time a new data entry is received
      int d = day();
      int m = month();
      int y = year();
      int h = hour();
      int min = minute();
      int s = second();
      float[] data;

      if(mySerial.available() &gt; 0)
      {
        //set the value recieved as a String
        //String value = mySerial.readString();
        String[] value =  loadStrings(mySerial.readString());
        data = float(split(value[0], ','));
        //check to make sure there is a value
        if(value != null)
        {
          //add a new row for each value
          TableRow newRow = table.addRow();
          //place the new row and date under the "Date" column
          newRow.setString("Date", str(d) + "/" + str(m) + "/" + str(y));
          //place the new row and time under the "Time" column
          newRow.setString("Time", str(h) + ":" + str(min) + ":" + str(s));
          //place the new row and value under the "Data" column
          newRow.setString("Occupancy", data[1]);
          newRow.setString("Lights", data[2]);
          newRow.setString("Door", data[3]);
          newRow.setString("Voltage", data[4]);
          newRow.setString("WindMPH", data[5]);
          newRow.setString("TempC", data[6]);



        }
      }
    }

    void keyPressed()
    {
      //variables used for the filename timestamp
      int y = year();
      int d = day();
      int m = month();
      int h = hour();
      int min = minute();
      int s = second();
      //variable as string under the data folder set as (mm-dd--hh-min-s.csv)
      filename = str(m) + "-" + str(d) + "-" + str(y) + "--" + str(h) + "-" + str(min) + "-" + str(s) + ".csv";
      //save as a table in csv format(data/table - data folder name table)
      saveTable(table, filename);
      exit();
    }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Alternative to FloatDict</title>
      <link>https://forum.processing.org/two/discussion/24564/alternative-to-floatdict</link>
      <pubDate>Sun, 15 Oct 2017 17:35:27 +0000</pubDate>
      <dc:creator>schotsl</dc:creator>
      <guid isPermaLink="false">24564@/two/discussions</guid>
      <description><![CDATA[<p>I want to store a high score with a name before, so an example would be "Schotsl 100" where Schotsl is my name and 100 my score. I though the FloatDict would be perfect since I can store one String and value in one set + I can just sort them based of the value which i exactly what i wanted!</p>

<p>Then it turned out I can only use the string once which is my where I run into problems since it means "Schotsl" can only have one high score, Is there another method I could use that would allow me to set create multiple strings with the same name but different high scores and then sort them based of the second value</p>
]]></description>
   </item>
   <item>
      <title>Convert String to float for drawing graph</title>
      <link>https://forum.processing.org/two/discussion/24220/convert-string-to-float-for-drawing-graph</link>
      <pubDate>Fri, 22 Sep 2017 19:39:28 +0000</pubDate>
      <dc:creator>pleink</dc:creator>
      <guid isPermaLink="false">24220@/two/discussions</guid>
      <description><![CDATA[<p>Hay everyone
I'm new here and I hope someone can help me with my little issue.
On my arduino is a sensor attached, that works fine. Also the transmission from the Arduino to the Processing program. The information comes as a String variable "val". To draw the graph I need to convert the variable into a float typ. I tried it with "Float.parseFloat(val)" but that didn't worked.</p>

<pre><code>import processing.serial.*;
Serial myPort;
Table table;

int numReadings = 100; //8640000 = One day
int readingCounter = 0;

String val;

float y = 0;
float t = 20;


void setup() {
  String portName = Serial.list()[0];

  myPort = new Serial(this, Serial.list()[0], 9600);
  table = new Table();

  table.addColumn("id");
  table.addColumn("month");
  table.addColumn("day");
  table.addColumn("hour");
  table.addColumn("minute");
  table.addColumn("second");

  table.addColumn("sensor1");

  size(1000, 1000);
  frameRate(10);
}

void draw() {

  if ( val != null) {
    y = Float.parseFloat(val);

  } else {
    y = 0;
  }
  rect(t, y, 5, 5);
  t = t + 5;
}

void serialEvent(Serial myPort) {

  try {
    String val = myPort.readStringUntil('\n');
    if (val!= null) {
      val = trim(val);
      println(val, y);  //Control
      float sensorValue[] = float(split(val, ','));

      TableRow newRow = table.addRow();
      newRow.setInt("id", table.lastRowIndex());

      newRow.setInt("month", month());
      newRow.setInt("day", day());
      newRow.setInt("hour", hour());
      newRow.setInt("minute", minute());
      newRow.setInt("second", second());

      newRow.setFloat("sensor1", sensorValue[0]); 
      println(table.lastRowIndex());

      readingCounter++;

      if (readingCounter == numReadings) {
        saveTable(table, "data/new.csv");
      }
    }
  }
  catch(RuntimeException e) {
    e.printStackTrace();
  }
}
</code></pre>

<p>In the console comes the following:</p>

<pre><code>    177 0.0
    java.lang.NullPointerException
        at Processing_uebertragung.serialEvent(Processing_uebertragung.java:73)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at processing.serial.Serial.serialEvent(Unknown Source)
        at jssc.SerialPort$EventThread.run(SerialPort.java:1112)
    179 0.0
    0
    181 0.0
    1
    183 0.0
    2
    185 0.0
    3
    186 0.0
    4
    188 0.0
    5
    190 0.0
</code></pre>

<p>sorry for my bad english.
 8-|</p>
]]></description>
   </item>
   <item>
      <title>Why does the displayed image seem to be using the i - 1 row rather than i?</title>
      <link>https://forum.processing.org/two/discussion/23749/why-does-the-displayed-image-seem-to-be-using-the-i-1-row-rather-than-i</link>
      <pubDate>Tue, 08 Aug 2017 19:50:55 +0000</pubDate>
      <dc:creator>heatseeking</dc:creator>
      <guid isPermaLink="false">23749@/two/discussions</guid>
      <description><![CDATA[<p>The idea is to display 1677 ellipses with certain colors dependent upon the 'heat/heet' value generated by using the data tables imported from some csv files. I have created output files to confirm the table data is being calculated as expected, however the generated image seems to be using the color of the PRIOR row (i minus 1) in the table, rather than the same row. I've excerpted the generated image and heat.csv table to illustrate.</p>

<p>I'm thinking the structure of the program is somehow causing this. I have tested my for loops and all the indexes seem to be correct at first glance.</p>

<pre><code>import java.util.Arrays;
import processing.pdf.*;
PImage img;
Seat[] seats;
Table locsTable;
Table tktdTable;

void setup() {
  img = loadImage("THEATREFULL.jpg");
  size(786, 1524);
  loadData();
}

void draw() {
  image(img, 0, 0);
  // Display all seats
  for (int i = 0; i&lt;seats.length; i++) {
    seats[i].display();
    /// PROBLEM: When displaying ellipses the value 'heet' seems to be using the 'heatcount' value from the i - 1 row instead of the i row.
  }
}

int countOccurrence(String seatArea, Table tableOfSeats) {
  int count = 0;
  for (int i = 0; i &lt;tableOfSeats.getRowCount(); i++) {
    if (seatArea.equalsIgnoreCase(tableOfSeats.getString(i, 0))) {
      count++;
    }
  }
  return count;
}

void loadData() {
  // "header" indicates the file has header row. The size of the array 
  // is then determined by the number of rows in the table. 

  tktdTable = loadTable("tally.csv", "header");
  tktdTable.addColumn("timestktd", Table.INT);
  locsTable = loadTable("locs.csv", "header");
  locsTable.addColumn("heatcount", Table.INT);
  seats = new Seat[locsTable.getRowCount()];

  for (int i = 0; i&lt;tktdTable.getRowCount(); i++) {
    // Iterate over all the rows in the Ticketed table.
    int heatcount = countOccurrence(tktdTable.getString(i, 0), tktdTable);
    tktdTable.setInt(i, "timestktd", heatcount);
  }

  for (int i = 0; i &lt; tktdTable.getRowCount(); i++) {
    TableRow rowt = tktdTable.getRow(i);
    //Test to see what the first indexed row is
    // TableRow rowone = tktdTable.getRow(0);
    //String sone = rowone.getString("seatarea");
    //println(sone);
    int match = locsTable.findRowIndex(rowt.getString("seatarea"), "seatarea");
    // if (match &lt; 0) {
    //   println(i, match);
    //  match = 0;
    // }   

    locsTable.setInt(match, "heatcount", rowt.getInt("timestktd"));
  }

  for (int i = 0; i&lt;locsTable.getRowCount(); i++) {
    // Iterate over all the rows in the Locations table.
    TableRow row = locsTable.getRow(i);
    //Test to see what the x indexed row is
    //TableRow rowone = locsTable.getRow(1676);
    //String sone = rowone.getString("seatarea");
    //String sheat = rowone.getString("heatcount");
    //println(sone + " " + sheat);

    // Access the fields via their column name (or index).
    float x = row.getFloat("coordX");
    float y = row.getFloat("coordY");
    int heat = row.getInt("heatcount");
    //println(i,x,y,heat);
    // Make a Seat object out of the data from each row.
    seats[i] = new Seat(x, y, heat);
  }

  saveTable(tktdTable, "data/counted.csv");
  saveTable(locsTable, "data/heat.csv");
}


class Seat {
  float u, v;
  int heet;

  Seat(float tempu, float tempv, int tempheet) {
    u = tempu;
    v = tempv;
    heet = tempheet;
  }


  void display() {
    // PROBLEM: When displaying ellipses the value 'heet' seems to be using the 'heatcount' value from the i - 1 row instead of the i row.
    ellipse(u, v, 11, 11);

    if (heet &gt;= 5 &amp;&amp; heet &lt;= 12) {
      fill(66, 244, 244);
    } else if (heet &gt;= 13 &amp;&amp; heet &lt;= 20) {
      fill(66, 244, 122);
    } else if (heet &gt;= 21 &amp;&amp; heet &lt;= 28) {
      fill(66, 244, 66);
    } else if (heet &gt;= 29 &amp;&amp; heet &lt;= 36) {
      fill(122, 244, 66);
    } else if (heet &gt;= 37 &amp;&amp; heet &lt;= 44) {
      fill(244, 244, 66);
    } else if (heet &gt;= 45 &amp;&amp; heet &lt;= 52) {
      fill(244, 122, 66);
    } else if (heet &gt;= 53) {
      fill(244, 66, 66);
    } else {
      fill(66, 122, 244);
    }
  }
}
</code></pre>

<p><img src="https://forum.processing.org/two/uploads/imageupload/185/8U0WR78K82KS.jpg" alt="offbyoneseat" title="offbyoneseat" /></p>
]]></description>
   </item>
   <item>
      <title>Program freezes on loadTable()</title>
      <link>https://forum.processing.org/two/discussion/23089/program-freezes-on-loadtable</link>
      <pubDate>Fri, 16 Jun 2017 14:34:59 +0000</pubDate>
      <dc:creator>adomarc</dc:creator>
      <guid isPermaLink="false">23089@/two/discussions</guid>
      <description><![CDATA[<p>The following program appears to freeze on the loadTable() line. I can get the program to work fine in debugger mode by stepping through the code but it does not seem to want to execute properly with the normal run mode.</p>

<pre><code>Table dotdata;
String filepath="";
String savefilepath="";
int columncount= 0;
int rowcount=0;

void setup() {
  size(500, 500);
  background(0);
  dotdata=new Table();
}

void draw() {
  selectInput("Select .txt file", "fileSelected");

  while (filepath=="") {
  };

  dotdata = loadTable(filepath, "tsv");
  print("hello");

  for (int i=0; i&lt;7; i++) {
    dotdata.removeRow(0);
  }
  dotdata.removeColumn(5);
  dotdata.removeColumn(4);
  dotdata.removeColumn(1);
  dotdata.removeColumn(0);

  dotdata.addColumn();
  dotdata.addColumn();
  dotdata.addColumn();

  //int columncount= dotdata.getColumnCount();
  int rowcount=dotdata.getRowCount();


  for (int i=0; i&lt;rowcount; i++) {
    dotdata.setFloat(i, 2, dotdata.getFloat(i, 0)+150);
    dotdata.setFloat(i, 3, dotdata.getFloat(i, 1)-150);
  }

  for (int i=0; i&lt;rowcount; i++) {
    dotdata.setString(i, 4, str(dotdata.getFloat(i, 2)) + "," + str(dotdata.getFloat(i, 3)));
  }

  filepathnaming();

  saveTable(dotdata, savefilepath);
  exit();
}



void fileSelected(File selection) {
  if (selection == null) {
    println("Window was closed or the user hit cancel.");
    exit();
  } else {
    filepath=selection.getAbsolutePath();
  }
}

void filepathnaming() {
  savefilepath="";
  String[] filepathlist = split(filepath, "\\");

  for (int i=0; i&lt;filepathlist.length-1; i++) {
    savefilepath +=filepathlist[i]+ "\\";
  }

  savefilepath += filepathlist[filepathlist.length-1].substring(0, filepathlist[filepathlist.length-1].indexOf(".txt"))+"_update.csv";

  println(savefilepath);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How can i save Toogle state in csv?</title>
      <link>https://forum.processing.org/two/discussion/22879/how-can-i-save-toogle-state-in-csv</link>
      <pubDate>Fri, 02 Jun 2017 17:36:19 +0000</pubDate>
      <dc:creator>newen</dc:creator>
      <guid isPermaLink="false">22879@/two/discussions</guid>
      <description><![CDATA[<p>I would like to write a program which works a LED.
If the toggle true the white circle has disappear and save the toggle state 1 in csv
If the toggle false the white circle has appear and save the toggle state 0 in the same row.
But the program just save the same number what i define in int x1 and not the toggle state what i want.
Int this point i can get.</p>

<p>import controlP5.*;
Table table;
ControlP5 cp5;</p>

<p>int col = color(255);
controlP5.Toggle b;</p>

<p>boolean setVisible=true;
int inside = -1;
int x1= 0;</p>

<p>void setup() {
  size(400,400);
  smooth();</p>

<p>table = new Table();</p>

<p>cp5 = new ControlP5(this);
  table.addColumn("kapcsolo1",Table.INT);</p>

<p>TableRow newRow = table.addRow();
  newRow.setInt("kapcsolo1", x1);</p>

<p>saveTable(table, "data/new.csv");
  // create a toggle and change the default look to a (on/off) switch look
  b = cp5.addToggle("toggle")
     .setPosition(40,250)
     .setSize(50,20)
     .setValue(true)
     .setMode(ControlP5.SWITCH)
     .setVisible(true)
     ;</p>

<p>}</p>

<p>void draw() {
  background(0);</p>

<p>pushMatrix();</p>

<p>translate(280,100);
  if(inside==1)
  ellipse(0,0,100,100);</p>

<p>popMatrix();
}</p>

<p>void toggle(boolean theFlag) {
  if(theFlag==true) {
    inside=inside<em>-1;
    x1=1;
  } else {
    inside=inside</em>-1;
    x1=0;
  }
}</p>
]]></description>
   </item>
   <item>
      <title>how to sort 2 arrays using java implement?</title>
      <link>https://forum.processing.org/two/discussion/22107/how-to-sort-2-arrays-using-java-implement</link>
      <pubDate>Thu, 20 Apr 2017 14:42:07 +0000</pubDate>
      <dc:creator>vapeur</dc:creator>
      <guid isPermaLink="false">22107@/two/discussions</guid>
      <description><![CDATA[<p>I was trying to sort an array of  object [] people, within each people object, I have 2 parameters, height and weight.
I use JAVA script to sort height, using</p>

<pre><code>int compareTo(Object objI)  
  {
    Individual iToCompare = (Individual) objI;  //cast object to individual
    if(height &lt; iToCompare.height)
    {
      return -1;
    }
    else if(height &gt; iToCompare.height)
    {
      return 1;
    }
    return 0;
  }
</code></pre>

<p>and then use</p>

<p><code>Arrays.sort(pop);</code></p>

<p>to sort my people according to height,
but I also want another sort according to weight, how should I do that....?</p>
]]></description>
   </item>
   <item>
      <title>saving data/variables in processing</title>
      <link>https://forum.processing.org/two/discussion/20305/saving-data-variables-in-processing</link>
      <pubDate>Mon, 16 Jan 2017 19:36:42 +0000</pubDate>
      <dc:creator>merbb</dc:creator>
      <guid isPermaLink="false">20305@/two/discussions</guid>
      <description><![CDATA[<p>Hello everyone</p>

<p>In my program im using several variables and I want to save them to txt file or excel file. After that I will make some graphs with them in other program.
<a href="http://scr.hu/5o3i/35y8h" target="_blank" rel="nofollow">http://scr.hu/5o3i/35y8h</a>   here is my variables. I know how to show them in console by println but idk how to save them. 
Saw saveTable and saveStrings but i dont know how to use them to my program.</p>

<p>thx for help</p>
]]></description>
   </item>
   <item>
      <title>How to solve error message "table cannot be resolved to a variable"</title>
      <link>https://forum.processing.org/two/discussion/19985/how-to-solve-error-message-table-cannot-be-resolved-to-a-variable</link>
      <pubDate>Thu, 29 Dec 2016 22:59:00 +0000</pubDate>
      <dc:creator>uomodellamansarda</dc:creator>
      <guid isPermaLink="false">19985@/two/discussions</guid>
      <description><![CDATA[<p>I am a newbie, i searched on StackOverflow and in the Processing Forum before post this question. 
I also read also the common section questions.</p>

<p>I copied/pasted this sketch from the processing site tutorial :
<a rel="nofollow" href="https://processing.org/reference/Table.html">https://processing.org/reference/Table.html</a></p>

<pre><code>void setup() {

  table = new Table();

  table.addColumn("id");
  table.addColumn("species");
  table.addColumn("name");

  TableRow newRow = table.addRow();
  newRow.setInt("id", table.lastRowIndex());
  newRow.setString("species", "Panthera leo");
  newRow.setString("name", "Lion");

  saveTable(table, "data/new.csv");
}

// Sketch saves the following to a file called "new.csv":
// id,species,name
// 0,Panthera leo,Lion
</code></pre>

<p>It gives me the following error message "The variable "Table" does not exist".</p>

<p>Sorry if the question is too stupid! :) 
Thanks in advance</p>
]]></description>
   </item>
   <item>
      <title>Multi-Column table filtering</title>
      <link>https://forum.processing.org/two/discussion/19769/multi-column-table-filtering</link>
      <pubDate>Thu, 15 Dec 2016 18:03:34 +0000</pubDate>
      <dc:creator>diyoyo</dc:creator>
      <guid isPermaLink="false">19769@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I was wondering whether there was a simple way to filter a table with multiple column criteria?</p>

<p>so far, my current work-around is to create the following class:</p>

<pre><code>public class FilterTable extends Table {

public FilterTable() {
    super();
}


public FilterTable(Iterable&lt;TableRow&gt; rows) {
    super(rows);
}

public FilterTable filter(String field, String value) {

    FilterTable result = new FilterTable(this.findRows(value, field));
    for (int i = 0; i &lt; getColumnCount(); i++) {
        result.addColumn(getColumnTitle(i), getColumnType(i));
    }

    return result;
}

public FilterTable filterLike(String field, String value) {

    FilterTable result = new FilterTable(matchRows(value, field));
    for (int i = 0; i &lt; getColumnCount(); i++) {
        result.addColumn(getColumnTitle(i), getColumnType(i));
    }

    return result;
}

}
</code></pre>

<p>and then to call it like this:</p>

<pre><code>  for(TableRow row:myFilterTable.filter("animal", "leopard").filter("age", "10").rows()){
      // do something.
}
</code></pre>

<p>Thanks.</p>
]]></description>
   </item>
   <item>
      <title>Table class, addColumn() has a CATEGORY type. What is that?</title>
      <link>https://forum.processing.org/two/discussion/19100/table-class-addcolumn-has-a-category-type-what-is-that</link>
      <pubDate>Thu, 17 Nov 2016 20:49:49 +0000</pubDate>
      <dc:creator>ajohnsonlaird</dc:creator>
      <guid isPermaLink="false">19100@/two/discussions</guid>
      <description><![CDATA[<p>The description of the <strong>type</strong> parameters indicates "int: the type to be used for the new column: INT, LONG, FLOAT, DOUBLE, STRING, or <strong>CATEGORY</strong>".</p>

<p>What is the CATEGORY type please? How is it used? I've been googling my brains out to trying and find the answers to these question -- and I have looked at the source code for Table.java and I still cannot reverse engineer it well enough to understand what it is. (The author clearly doesn't like HashTables -- there's a class called HashTablesBlow! :) )</p>

<p>Thanks in advance for anyone who can explain it!
Andy</p>
]]></description>
   </item>
   <item>
      <title>NullPointerException when trying to write a csv using Intelij as an ide</title>
      <link>https://forum.processing.org/two/discussion/18374/nullpointerexception-when-trying-to-write-a-csv-using-intelij-as-an-ide</link>
      <pubDate>Sun, 02 Oct 2016 11:48:48 +0000</pubDate>
      <dc:creator>Magnetic_Garden</dc:creator>
      <guid isPermaLink="false">18374@/two/discussions</guid>
      <description><![CDATA[<p>I made this in Intelij, with processing, trying to write a csv. But this code gives me an error 'Exception in thread "Animation Thread" java.lang.NullPointerException' when I write the csv with saveTable, why?</p>

<p>When I print out the table I get 'processing.data.Table@66ede931', giving me proof
that the table is really there!, so the bug must be the in the path?</p>

<pre><code>import processing.core.PApplet;
import processing.data.Table;
import processing.data.TableRow;    

public class WriteCsv {

    static PApplet parent;

    public WriteCsv(PApplet p) {
        parent = p;
    }

    Table table;

    public void createNewCsv() {

       table.addColumn("M_Phase");//342
       table.setInt(1, "M_Phase", 0);//342

       parent.println("table : " + table  ); // prints out 'processing.data.Table@66ede931', so table is not a null!!
       parent.saveTable( table, "data/info.csv" );
}
}
</code></pre>

<p>Any ideas what can cause the this error?</p>
]]></description>
   </item>
   <item>
      <title>How to send Arduino data to Processing and save it on PC</title>
      <link>https://forum.processing.org/two/discussion/18104/how-to-send-arduino-data-to-processing-and-save-it-on-pc</link>
      <pubDate>Wed, 07 Sep 2016 15:01:54 +0000</pubDate>
      <dc:creator>JRob</dc:creator>
      <guid isPermaLink="false">18104@/two/discussions</guid>
      <description><![CDATA[<p>Hello everybody!</p>

<p>I'm currently using Arduino to control an LED-strip (as semicircle) of 180 LEDs with an Arduino Uno board.
My Arduino sketch has the following process operation:
The LEDs are blinking one after another and start with a frequency of 50Hz and go down to 20 Hz before they switch forward. 
In addition to that, there is a button which can be pressed for instant switching, whereby the frequency and the respective LED-number are send over a serial port, so you can see them in the serial Monitor (Arduino).</p>

<p>Now I would like to save these data on my PC with help of Processing. I know that there are many tutorials and articles to find but I only found Processing-codes to save sensorsinput.
I guess there is a simple the solution, but I'm a total greenhorn in programming (especially Processing) and would like an opinion about my current "work" (I don't even know if my code is even sligthly correct :D)</p>

<p>And of course my crappy (sorry for vile language^^) Processing sketch:
Note that the framework is from codes I found in other posts!</p>

<pre><code>import processing.data.Table;
import processing.serial.*;


Serial myPort; //creates a software serial port
Table dataTable; //table to store values.

int numReadings = 500; //keeps track of how many readings one would like to take before writing the file. 
int readingCounter = 0; //counts each reading to compare to numReadings. 
float Winkel;
String Wink;



String fileName;
void setup()
{
  String portName = Serial.list()[0]; 

  myPort = new Serial(this, portName, 9600); //set up your port to listen to the serial port

  dataTable = new Table();
  dataTable.addColumn("id"); //This column stores a unique identifier for each record. We will just count up from 0 - so the first reading will be ID 0, the second will be ID 1, etc. 

  //the following adds columns for time.
  dataTable.addColumn("year");
  dataTable.addColumn("month");
  dataTable.addColumn("day");
  dataTable.addColumn("hour");
  dataTable.addColumn("minute");
  dataTable.addColumn("second");

  //columns for values
  dataTable.addColumn("Winkel");
  dataTable.addColumn("Frequenz");
}

  void draw() { 
    TableRow newRow = dataTable.addRow(); //add a row for this new reading
    newRow.setInt("id", dataTable.lastRowIndex());//record a unique identifier (the row's index)

    Wink = myPort.readString();
    println(Winkel);

    //record time stamp
    newRow.setInt("year", year());
    newRow.setInt("month", month());
    newRow.setInt("day", day());
    newRow.setInt("hour", hour());
    newRow.setInt("minute", minute());
    newRow.setInt("second", second());

    //record information. 
    newRow.setFloat("Winkel", Winkel);


    readingCounter++; //optional, use if you'd like to write your file every numReadings reading cycles

    //saves the table as a csv in the same folder as the sketch every numReadings. 
    if (readingCounter % numReadings ==0)//The % is a modulus, a math operator that signifies remainder after division. The if statement checks if readingCounter is a multiple of numReadings (the remainder of readingCounter/numReadings is 0)
    {
      fileName = str(year()) + str(month()) + str(day()) + str(dataTable.lastRowIndex()); //filename: year+month+day+readingCounter
      saveTable(dataTable, fileName); // save it to computer.
    }
}
</code></pre>

<p>The idea here is just to get the frequency (in German: Frequenz) and angle (in German: Winkel) data in a file. It doesn't have to look fancy.
I do hope that I provided you with every necessary information! I can also add a screenshot of the serial monitor from Arduino by request.</p>

<p>Many thanks in advance for your help!</p>
]]></description>
   </item>
   <item>
      <title>Save Meassurement Data with processing to excel</title>
      <link>https://forum.processing.org/two/discussion/17247/save-meassurement-data-with-processing-to-excel</link>
      <pubDate>Tue, 21 Jun 2016 11:05:59 +0000</pubDate>
      <dc:creator>Daniel1806</dc:creator>
      <guid isPermaLink="false">17247@/two/discussions</guid>
      <description><![CDATA[<p>Hi Guys,
I want to save meassurement datas from my arduino Nano with processing in an excel file.
To test my code I programmed the arduino to print the integer number 20 every 100msec to the serial monitor.</p>

<p>This is my processing code:</p>

<pre><code>import processing.serial.*;
Serial myPort;

Table table;

int val;
int numReadings = 10; 
int readingCounter = 0;

void setup() {
 String portName = Serial.list()[0];
 myPort = new Serial(this, portName, 9600);

  table = new Table();

  table.addColumn("id");
  table.addColumn("minute");
  table.addColumn("second");
  table.addColumn("wert");


}

void draw() {

  val = myPort.read();
  println(val);

      TableRow newRow = table.addRow();
  newRow.setInt("id", table.lastRowIndex());
  newRow.setInt("minute", minute());
  newRow.setInt("second",second());
  newRow.setInt("wert", val);

  readingCounter++;

 if (readingCounter % numReadings ==0)
 {
   saveTable(table, "data/new8.csv");
 }
}
</code></pre>

<p>it should simply print:
number of table row, minute, second, 20</p>

<p>but it prints:</p>

<p>88,37,58,50</p>

<p>89,37,58,48</p>

<p>90,37,58,13</p>

<p>91,37,58,10</p>

<p>92,37,58,-1</p>

<p>93,37,58,-1</p>

<p>94,37,58,50</p>

<p>95,37,58,48</p>

<p>96,37,58,13</p>

<p>97,37,58,10</p>

<p>98,37,58,-1</p>

<p>99,37,58,-1 and so on...</p>

<p>why does it show 50 then 48 then 13 then 10 and then two times -1?
And how can I convert that to the original integer number 20?</p>

<p>I tried this:</p>

<pre><code> val = myPort.readString();
 newRow.setString("wert", val);
</code></pre>

<p>but then the value 20 is only in the last row of the excel file. In all other rows only row id, minute and seconds are printed. Like this:</p>

<p>82,8,58,</p>

<p>83,8,58,</p>

<p>84,8,58,</p>

<p>85,8,59,</p>

<p>86,8,59,</p>

<p>87,8,59,"20</p>
]]></description>
   </item>
   <item>
      <title>Can't save data into CSV in the right place</title>
      <link>https://forum.processing.org/two/discussion/15551/can-t-save-data-into-csv-in-the-right-place</link>
      <pubDate>Fri, 18 Mar 2016 02:22:24 +0000</pubDate>
      <dc:creator>cheneva</dc:creator>
      <guid isPermaLink="false">15551@/two/discussions</guid>
      <description><![CDATA[<p>I am writing a function while the mouse is pressed, the timer will be record the exact time and save to a csv file during a specific time( the limit time of the mouse pressed is 10 times) While users are using the programme, it will keep going. (start again and again automatically)</p>

<p>I had done it successfully save to the right table. However, if users restart second times, the data of the second time will save in the wrong place and so on!</p>

<p>You can see that there is a blank about 10 rows in the B column....
I have no idea how to deal with this problem...</p>

<p><a href=""></a><img src="https://forum.processing.org/two/uploads/imageupload/162/4H5ILX4E1QDL.png" alt="螢幕快照 2016-03-18 02.18.09" title="螢幕快照 2016-03-18 02.18.09" /></p>

<p>The code that I had written.....</p>

<hr />

<p>void mousePressed() {</p>

<pre><code> if (mouseX &gt; startBtnX &amp;&amp; mouseX &lt; startBtnX+startBtnW &amp;&amp; mouseY &gt; startBtnY &amp;&amp; mouseY &lt; startBtnY+startBtnH) {
   buttonPressed = true;
 }

 if (mouseButton == LEFT) { 
   println("timer started");
   mouseClicks++; 
   sw = new StopWatchTimer();
   sw.start();//store the current time 
  }

 if (mouseClicks == limit) { 
    saveTable(table, "data/data.csv");
    table.addColumn("id");
    sw.reset();
    mouseClicks = 0;
    //output.close();
    buttonPressed = false;

  }  
</code></pre>

<p>class StopWatchTimer {</p>

<p>TableRow newRow = table.addRow();
float ct = (currentTime/1000);
String nct = ""+ct;</p>

<p>void start() {
    currentTime = millis() - startTime;
    println((currentTime/1000)-1);
    newRow.setString("id",nct);</p>

<p>}
   void reset() {
    currentTime = 0;
    startTime = millis();
    println("timer started");</p>

<p>}
}</p>
]]></description>
   </item>
   <item>
      <title>Creating Tables</title>
      <link>https://forum.processing.org/two/discussion/14756/creating-tables</link>
      <pubDate>Thu, 04 Feb 2016 11:42:16 +0000</pubDate>
      <dc:creator>rodrigolebrun</dc:creator>
      <guid isPermaLink="false">14756@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone.
So I'm now entering the world of creating, fetching and parsing data. Very very early stages at the moment and I'm already sweating. My task was to create a table that would save mouseX and mouseY data onto a table of max 10 lines. Pretty simple, pretty straight forward, but it doesn't work. I spent quite a good deal of time trying to understand why, iterating but I keep on getting the same error: "Array  index out of range:0" ... Help?
Here's the code. Thanks!</p>

<pre><code>Table table;
int counter=0;

void setup() {
  size(); 
  table= new Table();
  table.addColumn("id", Table.INT);
  table.addColumn("valueX", Table.INT);
  table.addColumn("valueY", Table.INT);
  saveTable(table, "data/new.csv");
}


void draw() {
  TableRow row=table.addRow();
  row.setInt("id", counter);
  row.setInt("valueX", mouseX);
  row.setInt("valueY", mouseY);

  counter++;



  //if (table.getRow()&gt;10) {
  //  table.removeRow(0);


  //}
}

void mousePressed() {
  exit();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to make a csv file with test data</title>
      <link>https://forum.processing.org/two/discussion/8104/how-to-make-a-csv-file-with-test-data</link>
      <pubDate>Wed, 12 Nov 2014 04:41:14 +0000</pubDate>
      <dc:creator>palmhoej</dc:creator>
      <guid isPermaLink="false">8104@/two/discussions</guid>
      <description><![CDATA[<p>Okay so i am collecting some data with and arduino and sending them to processing. Here they are stored in an int array. I want to put this int array down in one column with a header (String) in a CSV file. But i want to be able to keep adding columns with data, as the data comes in from the arduino. But i am confused by the row.setInt(nameOfData, array[i]) function. Why can't i, like the .getInt(row, column), specify which column and row i wan't to do manipulation with?</p>

<p>My code looks like this:</p>

<pre><code>int hammerArDatRaw[] = {
  2000, 2100, 2200, 2300, 3000, 4000, 3000
};

Table table;
TableRow row;

String nameOfExperiment = "Experiment";
int numberOfStrokeSaved = 0;



void setup() {
  table = new Table();
  WriteDataToCSVFile(hammerArDatRaw, "kkk");
  WriteDataToCSVFile(hammerArDatRaw, "skr");
  makeCSVFile(nameOfExperiment);
}

void makeCSVFile(String name) {
  saveTable(table, "data/"+nameOfExperiment+".csv");
}

void WriteDataToCSVFile(int array[], String nameOfData) {
  table.addColumn(nameOfData, Table.INT);
  row = table.addRow();


  for (int i = 0; i&lt; array.length; i++) {
    row.setInt(nameOfData, array[i]);
    row = table.addRow();
  }
}
</code></pre>

<p>As one can if they open the CSV file it looks like this:</p>

<blockquote class="Quote">
  <p>kkk   skr
  2000    0
  2100    0
  2200    0
  2300    0
  3000    0
  4000    0
  3000    0
  0   0
  0   2000
  0   2100
  0   2200
  0   2300
  0   3000
  0   4000
  0   3000
  0   0</p>
</blockquote>

<p>(Okay the quote system turned the columns sideways, so flip it 90 deg and you see my problem).</p>

<p>I don't want the zeroes but want the data to begin from the top everytime i call WriteDataToCSVFile(). What am i doing wrong?</p>
]]></description>
   </item>
   <item>
      <title>Create a graph (live-feed or after data collection) of sensor data from an Arduino serial port</title>
      <link>https://forum.processing.org/two/discussion/13679/create-a-graph-live-feed-or-after-data-collection-of-sensor-data-from-an-arduino-serial-port</link>
      <pubDate>Fri, 27 Nov 2015 02:51:52 +0000</pubDate>
      <dc:creator>SamCE</dc:creator>
      <guid isPermaLink="false">13679@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I have a code which takes data from 2 sensors that is incoming through the serial port of an Arduino and outputs it into a .csv file. This data is received as a float of the format "y, x" which is then delimited/split by the use of the comma and put into an array. The "y" data is a depth in mm measurement and the "x" is a correlating distance moved in mm.</p>

<p>I have been trying to get the code to output either a live-feed line graph or a line graph after the file is written with data "x" on the x-axis and "y" on the y-axis.</p>

<p>My experience with Processing is very limited and I have tried with no luck to adapt pretty much all of the examples I could find on the various forums and tutorials. Any help that could be offered would be very gratefully received, I don't mind if the solution is live-feed or after the .csv is written just having a graph out would be great.</p>

<p>Below I have shown a plot I did manually in excel to show the kind of output I am trying to get as well as the code I have got already which I have annotated on to try to make understanding my process as pain-free as possible.</p>

<p><img src="" alt="" /><img src="https://forum.processing.org/two/uploads/imageupload/807/GNM4FELYYQN3.jpg" alt="Output_Example" title="Output_Example" /></p>

<pre><code>import processing.serial.*;
Serial myPort; //creates a software serial port
Table dataTable; //table where values are stored
Table table; 

int numReadings = 500; //number of readings from sensors until .csv file is written
int readingCounter = 0; //counts each reading to compare to numReadings. 

String val;
String fileName;

void setup()
{
  String portName = Serial.list()[0]; //defines COM port

  myPort = new Serial(this, portName, 9600); //port setup, 9600 baud rate

  table = new Table();

  //table.addColumn("id"); //id number for incoming data starting

  //the following adds columns for time. (currently not used)
  //table.addColumn("year");
  //table.addColumn("month");
  //table.addColumn("day");
  //table.addColumn("hour");
  //table.addColumn("minute");
  //table.addColumn("second");
  //table.addColumn("milliseconds");

  //the following adds columns for each sensor set. Change for sensors and keep in correct order.
  table.addColumn("Depth");
  table.addColumn("Width");

}

void serialEvent(Serial myPort){

  try {
  val = myPort.readStringUntil('\n'); //The newline separator separates each Arduino loop and so collection of data. 
  if (val!= null) { //Verifies reading
    val = trim(val); //gets rid of any whitespace or Unicode nonbreakable space
    println(val); //Shows received data
    float sensorVals[] = float(split(val, ',')); //parses the packet from Arduino and places the float values into the sensorVals array.

    TableRow newRow = table.addRow(); //adds a row for new reading
    //following not used at present
    //newRow.setInt("id", table.lastRowIndex());//record an id for readings

    //record time stamp
    //newRow.setInt("year", year());
    //newRow.setInt("month", month());
    //newRow.setInt("day", day());
    //newRow.setInt("hour", hour());
    //newRow.setInt("minute", minute());
    //newRow.setInt("second", second());

    //record sensor information. Make sure same as sensor column names.
    newRow.setFloat("Depth", sensorVals[0]);
    newRow.setFloat("Width", sensorVals[1]);

    readingCounter++; //writes file every numReadings reading cycles

    //saves the table as a csv in the same folder as the sketch every numReadings. 
    if (readingCounter % numReadings ==0)//checks number of readings is correct
    {
      fileName = str(year()) + str(month()) + str(day()) + str(table.lastRowIndex()); //filename is of the form year+month+day+readingCounter
      saveTable(table, fileName + ".csv"); //saves the data as a .csv
    }
   }
  }
  catch(RuntimeException e) {//catches errors
    e.printStackTrace();
  }

}

void draw () {

}
</code></pre>

<p>Sam</p>
]]></description>
   </item>
   <item>
      <title>Begrenzungszeichen beim speichern in excel</title>
      <link>https://forum.processing.org/two/discussion/13601/begrenzungszeichen-beim-speichern-in-excel</link>
      <pubDate>Sun, 22 Nov 2015 15:28:23 +0000</pubDate>
      <dc:creator>malerlein</dc:creator>
      <guid isPermaLink="false">13601@/two/discussions</guid>
      <description><![CDATA[<p>Schönen Sonntag zusammen
Ich habe einmal eine Frage zum abspeichern meiner Daten in Excel. Das speichern geht ja nur ich möchte gerne mit dem abspeichern erst in der 8. Zeile beginnen, das bekomme ich nicht hin und beim abspeichern habe ich immer die Begrenzungszeichen sprich Gänsefüsschen mit abgespeichert, das sieht dann so aus:</p>

<p><code>,    "Typ Schloss Stck.    ","Schliess Nr.     ","Nr    ","Schluessel Stck      ",Hauptschluessel  Anzahl
                                    1                0102-                  1                    2                                 6667                     X,,,,,
                                    1                0104-                  2                    2                                 6667                     X,,,,,
                                    1                0120-                  3                    2                                 6667                     X,,,,,
                                    1                0122-                  4                    2                                 6667                     X,,,,,
                                    1                0124-                  5                    2                                 6667                     X,,,,,
                                    1                0140-                  6                    2                                 6667                     X,,,,,
                                    1                0142-                  7                    2                                 6667                     X,,,,,
                                    1                0144-                  8                    2                                 6667                     X,,,,,
                                    1                0300-                  9                    2                                 6667                     X,,,,,
                                    1                0302-                10                    2                                 6667                     X,,,,,
                                    1                0304-                11                    2                                 6667                     X,,,,,
                                    1                0320-                12                    2                                 6667                     X,,,,,
                                    1                0322-                13                    2                                 6667                     X,,,,,
                                    1                0324-                14                    2                                 6667                     X,,,,,
                                    1                0340-                15                    2                                 6667                     X,,,,,
                                    1                0342-                16                    2                                 6667                     X,,,,,
                                    1                0344-                17                    2                                 6667                     X,,,,,
                                    1                2100-                18                    2                                 6667                     X,,,,,
                                    1                2102-                19                    2                                 6667                     X,,,,,
                                    1                2104-                20                    2                                 6667                     X,,,,,</code>
der Code sieht so aus:</p>

<pre><code>`void excel() { // func start

 Table table;
 String l1="    ";
 String l2="Typ Schloss Stck.    ";
 String l3="Schliess Nr.     ";
 String l4="Nr    ";
 String l5="Schluessel Stck      ";
 String l6="Hauptschluessel  Anzahl";



  table = new Table();  

  table.addColumn(l1);
  table.addColumn(l2);
  table.addColumn(l3);
  table.addColumn(l4);
  table.addColumn(l5);
  table.addColumn(l6);

  for (int x=0; x&lt;AT5; x++){    
  TableRow newRow = table.addRow();
  newRow.setString(0,zeilen[x]);  
  saveTable(table, "Kunden/"+kdnr+" excel kompl.csv"); 
  }

  for (int xx=0; xx&lt;zzz; xx++){    
  TableRow newRow = table.addRow(); 
  newRow.setString(0,folge1[xx]);  
  saveTable(table, "Kunden/"+kdnr+" excel folge.csv");
  datenspeicher();
  }
</code></pre>

<p>}  // func ende`</p>
]]></description>
   </item>
   <item>
      <title>lines</title>
      <link>https://forum.processing.org/two/discussion/12962/lines</link>
      <pubDate>Mon, 12 Oct 2015 14:05:27 +0000</pubDate>
      <dc:creator>btot</dc:creator>
      <guid isPermaLink="false">12962@/two/discussions</guid>
      <description><![CDATA[<p>Got another question for a second project. I want to have different lines labeled with months superposed. On that line are vertical lines marking different events. The user should be able to change between different events and for example you only see one line or if selected all off them superposed. Any tips?</p>
]]></description>
   </item>
   <item>
      <title>Problem using Strings after loadTable</title>
      <link>https://forum.processing.org/two/discussion/7073/problem-using-strings-after-loadtable</link>
      <pubDate>Sun, 07 Sep 2014 19:07:18 +0000</pubDate>
      <dc:creator>SteveT</dc:creator>
      <guid isPermaLink="false">7073@/two/discussions</guid>
      <description><![CDATA[<p>I'm confused. Obviously I am missing something basic.  If I put data in a table, I can use it normally, but if I save it to a file, then read it back it is not behaving the way I expect.</p>

<p>when my sketch has:</p>

<p><code>if (New_Table.getString(1, "P_String") == "Row2")</code></p>

<p>in the original Table it evaluates correctly, but if I save the Table and load it, then it always evaluates as false.</p>

<p>Here is a simplified bit of code demonstrating what I am getting.</p>

<pre><code>Table New_Table;
Table Loaded_Table;

New_Table = new Table();
Loaded_Table = new Table();

New_Table.addColumn("P_String");
New_Table.addColumn("P_Int");
New_Table.addColumn("P_Float");

New_Table.setString(0, "P_String", "Row1");
New_Table.setInt(0, "P_Int", 0);
New_Table.setFloat(0, "P_Float", 0.177);

New_Table.addRow();
New_Table.setString(1, "P_String", "Row2");
New_Table.setInt(1, "P_Int", 42);
New_Table.setFloat(1, "P_Float", 3.14);

saveTable(New_Table, "New_Table.csv", "csv");

Loaded_Table = loadTable("New_Table.csv", "header");

if (Loaded_Table.getInt(1, "P_Int") == 42) println("It behaves as I expect with Int");
else println("Int doesn't work either");

if (Loaded_Table.getFloat(1, "P_Float") == 3.14) println("And with Float");
else println("Flaot doesn't work either");
println();

print("The original String is " + New_Table.getString(1, "P_String"));
if (New_Table.getString(1, "P_String") == "Row2") println(" ... which is equal to Row2 in the original table");
else println("What is wrong here?");
println();

println("The Loaded String is " + Loaded_Table.getString(1, "P_String") + " which should be equal to Row2");
if (Loaded_Table.getString(1, "P_String") == "Row2") println("Ok it works as I expect");
else println("What is wrong here?");
</code></pre>

<p>The results are:</p>

<pre><code>It behaves as I expect with Int
And with Float

The original String is Row2 ... which is equal to Row2 in the original table

The Loaded String is Row2 which should be equal to Row2
What is wrong here?
</code></pre>
]]></description>
   </item>
   <item>
      <title>As simply as possible how do i write to a text file?</title>
      <link>https://forum.processing.org/two/discussion/1191/as-simply-as-possible-how-do-i-write-to-a-text-file</link>
      <pubDate>Mon, 11 Nov 2013 21:44:54 +0000</pubDate>
      <dc:creator>spamynator_1</dc:creator>
      <guid isPermaLink="false">1191@/two/discussions</guid>
      <description><![CDATA[<p>Making a game and i need to  write to a/some text file(s). i need to be able to save no more than a single string to a file. How could i most simply write to and read from a text file and store the information in variables?</p>
]]></description>
   </item>
   </channel>
</rss>