Hello to all,
I am fairly new to processing and I need help... I am clearly missing something!
I have two text files. The first one contains numbers from one to ten and the second one numbers from eleven to twenty. I need to copy one line of data on two in a new text file. At the end, the data should be in this order :
[0] 1
[1] 12
[2] 3
[3] 14
...
Here is my code so far :
PrintWriter newTextFile;
void setup() {
String lines[] = loadStrings("data/i1.txt");
String lines2[] = loadStrings("data/i2.txt");
newTextFile = createWriter("result/allData.txt");
// for (int j = 0 ; j < lines.length; j+=2) {
arrayCopy(lines2, 1, lines, 1, 1);
saveStrings("result/allData.txt", lines);
println(lines);
//}
}
void draw() {
}
I thought a for loop would do the trick but I am unable to implement it properly.
Also, since there will be much more text files and numbers in the future, is it a good way to proceed? Or should I try something else?
Thanks for your help!