Last active
August 29, 2015 14:18
-
-
Save phoenixperry/02bcb6df908322e17ff4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.Scanner; | |
String[] stuff; | |
//this array holds all data bouncing in - I used a file yours will be slightly different | |
void setup(){ | |
size(200,200); | |
stuff = loadStrings("data.txt"); | |
} | |
void draw(){ | |
for(int i=0; i<stuff.length; i++) | |
{ | |
//split file line by line and get all tabbed data and break at end line | |
Scanner sc = new Scanner(stuff[i]).useDelimiter("\t|\u0000"); | |
int counter = 0; | |
//just an example of keeping track - since you know there are 3 (0,1,2) elements in a string | |
//you can grab each one as data as needed and write that through to whatever variable you are using | |
while(sc.hasNext()) { | |
//since we are going line by line you'll need a while loop to get all 3 bits of data out. | |
println(sc.next()); | |
//get the next bit of data | |
println(counter); | |
//print out which val you have | |
println("--------------------------------"); | |
//toss in a breaker for sanity | |
counter++; | |
//up the counter. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adelle that does it. :)