Hi there!
I have a very short code that should clean up a dump file, but I get continuously errors because there’s a missing “{” and after 1h of frustrated staring, I need your help =)
ArrayList<String> rough = new ArrayList<String>();
ArrayList<String> sauber = new ArrayList<String>();
PrintWriter output;
String[] p;
String[] q;
void setup() {
size(400, 400);
output = createWriter("cleaned.txt");
String[] dump = loadStrings("savefile.xml");
for (int i=0; i < dump.length-6; i++) {
if (dump[i].equals("</computer>")) {
q = splitTokens(dump[i+1], str('"'));
if (dump[i+3].equals("firewall")) {
p = splitTokens(dump[i+6], str('"'));
} else {
p = splitTokens(dump[i+5], str('"'));
}
sauber.add(q[1]);
sauber.add(q[3]);
sauber.add(p[1]);
sauber.add(p[3]);
sauber.add(" // ");
printArray(sauber);
}
}
}
But processing keeps stating that it "Found a { that’s missing a matching }
i also see that as long line 20 is not disabled,
what even makes less sense as the first two splitTokens might work??
( here is your xml file not available )