/* LAB 14 live coding file */ String[] fileContents; String[] fileAsStrings; int[] fileAsInts; void setup() { //Load the file /* fileContents = loadStrings("month.csv"); //How was the file loaded? println(fileContents[0]); //Create an Integer array from the file's contents fileAsInts = int(split(fileContents[0], ',')); //Split file into one entry per string fileAsStrings = split(fileContents[0],','); println(); //what does the new array look like if we seperate and format? for(int i = 0; i < fileAsStrings.length - 1; i++) { if(i > 0 && i % 25 == 0) { println(fileAsStrings[i] + ", "); }else { print(fileAsStrings[i] + ", "); } } println(fileAsStrings[fileContents.length - 1]); println(); //What month is day #240 in??? println(fileAsInts[240]); //How can we delinearize this? //Using 30 as the length of our month int count = 2; print("Month 1: "); for(int i = 0; i < fileAsInts.length; i++) { if((i + 1) % 30 == 0) { print("\nMonth " + count + ": "); count++; } print(fileAsInts[i] + " "); } //Using the information of our elements count = 1; print("\n\n"); print("Month 1: "); for(int i = 0; i < fileAsInts.length; i++) { if(i > 0 && fileAsInts[i] > fileAsInts[i - 1]) { count++; print("\nMonth " + count + ": "); } print(fileAsInts[i] + " "); } */ } void draw() { }