pulling data from a text file
in
Programming Questions
•
1 year ago
I am trying to pull data from a text file on another computer everything works but the text file gets a new number every half second and processing does not update to the new number but if I go into the processing menus and add the file again replacing the file with the same one only with the new number it will show the new number.
Thanks in advance
- PFont f;
- PFont g;
- String[] lines;
- int index = 0;
- void setup() {
- size(700,720);
- f = createFont("Arial", 400, true);
- g = createFont("Arial", 100, true);
- noLoop();
- }
- void draw() {
- background(255);
- noStroke();
- //line(width/2,0,width/2,height);
- textFont(f);
- fill(0);
- String[] lines = loadStrings("compact.txt");
- String[] pieces = split(lines[index], '\t');
- // textAlign() sets the alignment for displaying text. It takes one argument: CENTER, LEFT, or RIGHT.
- textAlign(CENTER);
- text(pieces[0] ,width/2,400);
- textFont(g);
- fill(0);
- text("compactability" ,width/2,600);
- loop();
- }
1