<?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 addrow() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=addrow%28%29</link>
      <pubDate>Sun, 08 Aug 2021 18:51:35 +0000</pubDate>
         <description>Tagged with addrow() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedaddrow%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <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>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>Data and Timing Display</title>
      <link>https://forum.processing.org/two/discussion/23154/data-and-timing-display</link>
      <pubDate>Wed, 21 Jun 2017 09:44:46 +0000</pubDate>
      <dc:creator>mslba</dc:creator>
      <guid isPermaLink="false">23154@/two/discussions</guid>
      <description><![CDATA[<p>Hi all,</p>

<p>I would like to write a simple program that parses text data from a table and displays a row of text for a specified amount of time. Then I would like for that text to disappear and for the next row to appear for the same time interval.</p>

<p>I experimented with the Bubbles example to see how I would achieve that, but it seems that all the data that are in the table will appear with draw and whatever new bubbles are added through mousePressed will just be timed. I wouldn't like to use the mouse functionality so can anyone help me with achieving a redraw of my sketch so that one bubble appears at a time just based on seconds passed. Thank you, here's my code:</p>

<pre><code>Table table;
Bubble[] bubbles;
void setup() {
  size(480, 360);
  loadData();
  frameRate(1);
}
void draw() {
  background(255);
 drawWords(frameCount);
}
void drawWords(int count){
  // add code year to draw some words based on the number given in 'count'
   for (int i = 0; i&lt;bubbles.length; i++) {
    bubbles[i].display();

  }
}
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. 
  table = loadTable("data.csv", "header");
  bubbles = new Bubble[table.getRowCount()];
  for (int i = 0; i&lt;table.getRowCount(); i++) {
    // Iterate over all the rows in a table.
    TableRow row = table.getRow(i);
   // Access the fields via their column name (or index).
    float x = row.getFloat("x");
    float y = row.getFloat("y");
    float d = row.getFloat("diameter");
    String n = row.getString("name");
    // Make a Bubble object out of the data from each row.
    bubbles[i] = new Bubble(x, y, d, n);
  }
}
void mousePressed() {
  // When the mouse is pressed, create a new row and set the values for each column of that row.
  TableRow row = table.addRow();
  row.setFloat("x", mouseX);
  row.setFloat("y", mouseY);
  row.setFloat("diameter", random(40, 80));
  row.setString("name", "Blah");
// If the table has more than 10 rows, delete the oldest row.
  // This writes the table back to the original CSV file
  // and reloads the file so that what's drawn matches.
  saveTable(table, "data/data.csv");
  loadData();
}
// This simple Bubble class draws a circle to the window 
// and displays a text label when the mouse hovers.
class Bubble {
  float x, y;
  float diameter;
  String name;
  boolean over = false;
  // Create the Bubble
  Bubble(float tempX, float tempY, float tempD, String s) {
    x = tempX;
    y = tempY;
    diameter = tempD;
    name = s;
  }
  // Checking if mouse is over the bubble
  void rollover(float px, float py) {
    float d = dist(px, py, x, y);
    if (d&lt;diameter/2) {
      over = true; 
    } else {
      over = false;
    }
  }
  // Display the Bubble
  void display() {
    stroke(0);
    strokeWeight(2);
    noFill();
    ellipse(x, y, diameter, diameter);
      fill(0);
      textAlign(CENTER);
      text(name, x, y+diameter/2+20);
  }
}
//Ends Here
</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>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>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>saveTable doesn't work with loadTable</title>
      <link>https://forum.processing.org/two/discussion/16837/savetable-doesn-t-work-with-loadtable</link>
      <pubDate>Thu, 26 May 2016 02:45:41 +0000</pubDate>
      <dc:creator>hyungjoongkim</dc:creator>
      <guid isPermaLink="false">16837@/two/discussions</guid>
      <description><![CDATA[<p>Hi,I have been trying to add a new row to a loaded table(new.csv) and save.
However, the saved(replaced) .csv file does not show proper data but this strange symbols as below.
�w^~)�.</p>

<p>//this is what new.csv looks like.<br />
//id, species<br />
//1, a<br />
//2, b<br />
//3, c<br />
//4, d<br />
//5, e &lt;----- this row is what I want to add</p>

<p>and here is my code:</p>

<pre><code>
var table;
function preload() { 
  table = loadTable("new.csv", "csv", "header");
}
function setup() {
  var newRow = table.addRow();
  newRow.setString("id", 5);
  newRow.setString("species", "e");
  for (var r = 0; r &lt; table.getRowCount(); r++) {
    for (var c = 0; c &lt; table.getColumnCount(); c++) {
      println(table.getString(r, c));
    }
  }
  saveTable(table, 'new.csv');
}
</code></pre>

<p>The row is properly added when I println(table.getString(r, c)); but not in replaced new.csv file.
I tried to save it with different file name as new1.csv but still doesn't work.
Could you fix this problem for me? Thank you.</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 filter specific messages coming from arduino, and log them into an CSV?</title>
      <link>https://forum.processing.org/two/discussion/14532/how-to-filter-specific-messages-coming-from-arduino-and-log-them-into-an-csv</link>
      <pubDate>Tue, 19 Jan 2016 15:00:14 +0000</pubDate>
      <dc:creator>luisandresgonzalez</dc:creator>
      <guid isPermaLink="false">14532@/two/discussions</guid>
      <description><![CDATA[<p>Hello, glad to meet you all, this is my first post. I'm trying to setup a CSV file logging, in order to record some reaction time responses coming from arduino. So far i've managed to tweak some codes i've found in the internets and managed to get them to work sepparately: the first one (arduino side) measures the reaction time and prints it in the serial ("Your reaction time was:"). A different, processing code receives some data (button pressed or not) and logs it into a CSV file. The problem is, that this code will write ANY line that comes from the serial, which leaves no room for me to send useful message to the user (like "you pressed the button too early!").</p>

<p>**tl;dr **</p>

<p>Is there a way that I can modify the processing code to filter just the seconds of the reaction time instead of every line that comes from the serial?</p>

<p>Below there are 3 blocks of code:</p>

<p>1) the arduino code that i want to implement,</p>

<p>2) the processing code,</p>

<p>3) and the original arduino code meant for the processing code.</p>

<p>Arduino code so far:</p>

<p>(more readable pastebin here <a rel="nofollow" href="http://pastebin.com/Ej6jt6RZ">http://pastebin.com/Ej6jt6RZ</a>)</p>

<pre>

 /* REACTION TIME (with 2 leds) v1.1
  *  Luis Andrés Gonzalez
  * Reaction time original version from <a href="http://www.instructables.com/id/Arduino-Reaction-Time-Tester/?ALLSTEPS" target="_blank" rel="nofollow">http://www.instructables.com/id/Arduino-Reaction-Time-Tester/?ALLSTEPS</a>
  * Send data to processing via the Serial Port original from By Elaine Laguerta <a href="http://url/of/online/tutorial.cc" target="_blank" rel="nofollow">http://url/of/online/tutorial.cc</a>
 */
 int switchPin = 6;  // pin where the button will be connected
 int ledPin1 = 2 ;   // LED that signals starting of the game
 int ledPin2 = 8 ;   // LED that lights to test the reaction time
 
 // declare some variables:
 boolean lastButton = LOW;
 boolean currentButton = LOW;
 boolean Started = false;
 boolean timer = false;
 long startTime;
 long endTime;
 int randomTime;
 long beginTime;
 float elapsedTime;
 
 
 void setup()
 {
   // Setup button and LEDs:
   pinMode(switchPin, INPUT);
   pinMode(ledPin1, OUTPUT);
   pinMode(ledPin2, OUTPUT);
 
   // Begin serial communication
   Serial.begin(9600);
 }
 boolean debounce(boolean last)
 {
   boolean current = digitalRead(switchPin);
   if(last != current)
   {
     delay(5);
     current = digitalRead(switchPin);
   }
   return current;
 }
 
 
 void loop()
 {
   // see if button pressed
   currentButton = debounce(lastButton);
   if(lastButton == LOW &amp;&amp; currentButton == HIGH)
   {
     if(Started==false){
       Started=true;
       randomTime = random(4,10);
       randomTime = randomTime*1000;
       Blink();
       beginTime=millis(); 
       
     }
     else{
       if((millis()-beginTime)&gt;=randomTime){
           Stop();
           Started=false; 
           timer=false;         
       }
       
       else{
         Started=false;
         timer=false;
         Serial.println("You pressed the button too soon !");
         for(int i=0; i&lt;3; i++){
           Blink();
         }
       }
     }
   }
      
   lastButton = currentButton;
   
   if(Started == true &amp;&amp; (millis()-beginTime)&gt;=randomTime &amp;&amp; timer==false){
     Serial.println("Start");
     timer=true;
     Start();
   }
 }
   
 
 
 
 
 
 void Start(){
   startTime = millis();
   digitalWrite(ledPin1, HIGH);
 }
 
 void Blink(){
   digitalWrite(ledPin2, HIGH);
   delay(100);
   digitalWrite(ledPin2, LOW);
   delay(100);
 }
 
 void Stop(){
   endTime = millis();
   elapsedTime = (endTime - startTime)+5;
   elapsedTime = elapsedTime/1000;
   Serial.print("Time Seconds: ");
   Serial.println(elapsedTime);
   digitalWrite(ledPin1, LOW);
    
 }

</pre>

<p>Processing code:</p>

<p>(<a rel="nofollow" href="http://pastebin.com/EjEcuqct">http://pastebin.com/EjEcuqct</a>)</p>

<pre lang="processing">
 
 /* 
   Saving Values from Arduino to a .csv File Using Processing - Pseduocode
 
   This sketch provides a basic framework to read data from Arduino over the serial port and save it to .csv file on your computer.
   The .csv file will be saved in the same folder as your Processing sketch.
   This sketch takes advantage of Processing 2.0's built-in Table class.
   This sketch assumes that values read by Arduino are separated by commas, and each Arduino reading is separated by a newline character.
   Each reading will have it's own row and timestamp in the resulting csv file. This sketch will write a new file a set number of times. Each file will contain all records from the beginning of the sketch's run.  
   This sketch pseduo-code only. Comments will direct you to places where you should customize the code.
   This is a beginning level sketch.
 
   The hardware:
   * Sensors connected to Arduino input pins
   * Arduino connected to computer via USB cord
         
   The software:
   *Arduino programmer
   *Processing (download the Processing software here: <a href="https://www.processing.org/download/" target="_blank" rel="nofollow">https://www.processing.org/download/</a>
   *Download the Software Serial library from here: <a href="http://arduino.cc/en/Reference/softwareSerial" target="_blank" rel="nofollow">http://arduino.cc/en/Reference/softwareSerial</a>
 
   Created 12 November 2014
   By Elaine Laguerta
   <a href="http://url/of/online/tutorial.cc" target="_blank" rel="nofollow">http://url/of/online/tutorial.cc</a>
 
 */
 
 import processing.serial.*;
 Serial myPort; //creates a software serial port on which you will listen to Arduino
 Table table; //table where we will read in and store values. You can name it something more creative!
 
 int numReadings = 5; //keeps track of how many readings you'd like to take before writing the file. 
 int readingCounter = 0; //counts each reading to compare to numReadings. 
  
 String fileName;
 void setup()
 {
   String portName = Serial.list()[1]; 
   //CAUTION: your Arduino port number is probably different! Mine happened to be 1. Use a "handshake" sketch to figure out and test which port number your Arduino is talking on. A "handshake" establishes that Arduino and Processing are listening/talking on the same port.
   //Here's a link to a basic handshake tutorial: <a href="https://processing.org/tutorials/overview/" target="_blank" rel="nofollow">https://processing.org/tutorials/overview/</a>
   
   myPort = new Serial(this, portName, 9600); //set up your port to listen to the serial port
   table = new Table(); 
   table.addColumn("id"); //This column stores a unique identifier for each record. We will just count up from 0 - so your first reading will be ID 0, your second will be ID 1, etc. 
   
   //the following adds columns for time. You can also add milliseconds. See the Time/Date functions for Processing: <a href="https://www.processing.org/reference/" target="_blank" rel="nofollow">https://www.processing.org/reference/</a> 
   table.addColumn("year");
   table.addColumn("month");
   table.addColumn("day");
   table.addColumn("hour");
   table.addColumn("minute");
   table.addColumn("second");
   
   //the following are dummy columns for each data value. Add as many columns as you have data values. Customize the names as needed. Make sure they are in the same order as the order that Arduino is sending them!
   table.addColumn("sensor1");  
 
 }
 
 void serialEvent(Serial myPort){
   String val = myPort.readStringUntil('\n'); //The newline separator separates each Arduino loop. We will parse the data by each newline separator. 
   if (val!= null) { //We have a reading! Record it.
     val = trim(val); //gets rid of any whitespace or Unicode nonbreakable space
     println(val); //Optional, useful for debugging. If you see this, you know data is being sent. Delete if  you like. 
     int sensorVals = int(val); //parses the packet from Arduino and places the valeus into the sensorVals array. I am assuming floats. Change the data type to match the datatype coming from Arduino. 
    
     TableRow newRow = table.addRow(); //add a row for this new reading
     newRow.setInt("id", table.lastRowIndex());//record a unique identifier (the row's index)
     
     //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. Customize the names so they match your sensor column names. 
     newRow.setInt("sensor1", sensorVals);
     
     
     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)
     {
       //saveTable(table, "data/new.csv");
       fileName = "data/" + str(year()) + str(month()) + str(day()) + str(table.lastRowIndex()) + ".csv"; //this filename is of the form year+month+day+readingCounter
       saveTable(table, fileName); //Woo! save it to your computer. It is ready for all your spreadsheet dreams. 
     }
    }
 }
 
 void draw()
 { 
    //visualize your sensor data in real time here! In the future we hope to add some cool and useful graphic displays that can be tuned to different ranges of values. 
 }

</pre>

<p>The original Arduino code meant for the processing code above:</p>

<p>(<a rel="nofollow" href="http://pastebin.com/qQF7YbYN">http://pastebin.com/qQF7YbYN</a>)</p>

<pre>/*
Sending Data to Processing via the Serial Port
This sketch provides a basic framework to send data from Arduino to Processing over a Serial Port. This is a beginning level sketch.

Hardware:
* Sensors connected to Arduino input pins
* Arduino connected to computer via USB cord

Software:
*Arduino programmer
*Processing (download the Processing software here: <a href="https://www.processing.org/download/" target="_blank" rel="nofollow">https://www.processing.org/download/</a>

Additional Libraries:
*Read about the Software Serial library here: <a href="http://arduino.cc/en/Reference/softwareSerial" target="_blank" rel="nofollow">http://arduino.cc/en/Reference/softwareSerial</a>

Created 12 November 2014
By Elaine Laguerta
<a href="http://url/of/online/tutorial.cc" target="_blank" rel="nofollow">http://url/of/online/tutorial.cc</a>
*/

/*To avoid overloading the Arduino memory, and to encourage portability to smaller microprocessors, this sketch
does not timestamp or transform data. In this tutorial, timestamping data is handled on the processing side.

Whether you process data on the Arduino side is up to you. Given memory limitations of the Arduino, even a few computations and mapping of values can
max out the memory and fail. I recommend doing as little as possible on the Arduino board.*/

//#include SoftwareSerial.h

/*Declare your sensor pins as variables. I'm using Analog In pins 0 and 1. Change the names and numbers as needed
Pro tip: If you're pressed for memory, use #define to declare your sensor pins without using any memory. Just be careful that your pin name shows up NOWHERE ELSE in your sketch!
for more info, see: <a href="http://arduino.cc/en/Reference/Define" target="_blank" rel="nofollow">http://arduino.cc/en/Reference/Define</a>
*/
int sensor1Pin = 6;


/*Create an array to store sensor values. I'm using floats. Floats use 4 bytes to represent numbers in exponential notation. Use int if you are representing whole numbers from -32,768 to 32,767.
For more info on the appropriate data type for your sensor values, check out the language reference on data type: <a href="http://arduino.cc/en/Reference/HomePage" target="_blank" rel="nofollow">http://arduino.cc/en/Reference/HomePage</a>
Customize the array's size to be equal to your number of sensors.
*/
/*
 * Prueba de dejar esto afuera
 float sensorVals[] = {0,0,0}
*/
/*Pro tip: if you have a larger number of sensors, you can use a for loop to initialize your sensor value array. Here's sample code (assuming you have 6 sensor values):
float sensorVals[6];
int i;
for (i=0; i&lt;6; i++)
{
sensorVals[i] = 0;
}
*/

void setup(){
Serial.begin(9600); //This line tells the Serial port to begin communicating at 9600 bauds
}

//
void loop(){
//read each sensor value. We are assuming analog values. Customize as nessary to read all of your sensor values into the array. Remember to replace "sensor1Pin" and "sensor2Pin" with your actual pin names from above!
int sensorVal = digitalRead(sensor1Pin);

/*If you are reading digital values, use digitalRead() instead. Here's an example:
sensorVal[0] = digitalRead(sensor1Pin);
*/

//print over the serial line to send to Processing. To work with the processisng sketch we provide, follow this easy convention: separate each sensor value with a comma, and separate each cycle of loop with a newline character.
//Remember to separate each sensor value with a comma. Print every value and comma using Serial.print(), except the last sensor value. For the last sensor value, use Serial.println()
//Serial.print(sensors[0]);
//Serial.print(",");
//Serial.print(sensors[1]);
//Serial.print(",");
Serial.println(sensorVal);
delay(1000);
}
</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>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>
   </channel>
</rss>