Hello, I started Processing yesterday. I have imported CSV data into 2d array using a good public code, but I failed in reading it. Could you tell me why first "println(csv[0][0]); " works, but second "println(csv[0][0]); " makes error?
---------------------------
String lines[];
int csvWidth;
String [][] csv;
void setup() {
String lines[] = loadStrings("Book1.csv");
String [][] csv;
int csvWidth=0;
//calculate max width of csv file
for (int i=0; i < lines.length; i++) {
String [] chars=split(lines[i],',');
if (chars.length>csvWidth){
csvWidth=chars.length;
}
}
//create csv array based on # of rows and columns in csv file