I'm loading data in from a dataset, parsing it, and saving each variable into an array. I then would like to loop through the data, drawing each observation, and saving the resulting image. Unfortunately I can't seem to be able to call an array in the save() function -- the filename has to be entirely in quotes. Any thoughts?
The title says it all. I've a new user of Processing and I'm trying to figure out how to import data into Processing from a dataset and then convert some of the string arrays to integers or floating to start leveraging the data into shapes, colors, etc. But I can't seem to figure out how to convert the string array into an integer array. Below is the sample code I have been working on! Any help you can provide would be greatly appreciated!
println(items); /*This shows the different variables in the dataset */
int itemCount=items.length;
String[] pieces = new String[items.length];
String[] var1 = new String[items.length];
String[] var2 = new String[items.length];
String[] var3 = new String[items.length];
int[] var4 = new int[items.length];
for(int i=0;i<itemCount;i++){
pieces = split(items[i], '|');
var1[i]=pieces[0];
var2[i]=pieces[1];
var3[i]=pieces[2];
var4[i]=int(pieces[1]); /*This attempts to convert the numeric string into an integer */
};
println(var4); /*This spits out all zeros for me -- but they should be integers! */