Hello everyone;
Before I place my unorganized code in here, I have a question:
In my program I'm loading text from a file 'xyz'. This file has a strucutre as follows:
value 1; value 2; value 3; value 4; string 1;
value 1; value 2; value 3; value 4; string 1;
value 1; value 2; value 3; value 4; string 2;
value 1; value 2; value 3; value 4; string 2;
value 1; value 2; value 3; value 4; string 1;
It's a file with approxamitely 2000 lines, with several values (separated by ';') and finishing with one of several strings. The values also differ because they represent coordinates.
I've been able to load into an array all of these values and divide them at the semi-colon.
String[] stringA= loadStrings("actions.csv");
for (int i = 0; i < stringA.length; i++) {
String[] stringB = split(stringA[i], ';');
}
What I need is to isolate onto separate arrays the lines where the strings are similar. That is, put into an array X all the lines that have 'string1' (and corresponding values) and into an array Y all lines that have 'string2' and so forth.
I need this because I have several buttons (one for each type of string) and I want each button to control the appearance of independent values stored in string X, Y and so forth.
Any suggestions are appreciated :)
Before I place my unorganized code in here, I have a question:
In my program I'm loading text from a file 'xyz'. This file has a strucutre as follows:
value 1; value 2; value 3; value 4; string 1;
value 1; value 2; value 3; value 4; string 1;
value 1; value 2; value 3; value 4; string 2;
value 1; value 2; value 3; value 4; string 2;
value 1; value 2; value 3; value 4; string 1;
It's a file with approxamitely 2000 lines, with several values (separated by ';') and finishing with one of several strings. The values also differ because they represent coordinates.
I've been able to load into an array all of these values and divide them at the semi-colon.
String[] stringA= loadStrings("actions.csv");
for (int i = 0; i < stringA.length; i++) {
String[] stringB = split(stringA[i], ';');
}
What I need is to isolate onto separate arrays the lines where the strings are similar. That is, put into an array X all the lines that have 'string1' (and corresponding values) and into an array Y all lines that have 'string2' and so forth.
I need this because I have several buttons (one for each type of string) and I want each button to control the appearance of independent values stored in string X, Y and so forth.
Any suggestions are appreciated :)
1