CSV import for Processing

Here’s a some code for Processing to import csv files and parse the entries into a 2D array.

//for importing csv files into a 2d array
//by che-wei wang

String lines[] = loadStrings("list.csv");
String [][] csv;
int csvWidth=0;

//calculate max width of csv file
for (int i=0; i csvWidth){
    csvWidth=chars.length;
  }
}

//create csv array based on # of rows and columns in csv file
csv = new String [lines.length][csvWidth];

//parse values into 2d array
for (int i=0; i