Hey guys, I'm very new to processing and programming as a whole and wondered if you could tell me why my code isn't working. I have to read in lines of a csv file, and split it into pieces. Hopefully you can understand. It will print lines, however not pieces or records. The output is:
Mozambique,47,23390765,12,50
hmm$Record@359ecd80 <----- This is wrong
Thanks
Record[] records;
String[] lines;
int recordCount;
String[] pieces;
void setup(){
lines = loadStrings("main.csv");
records = new Record[lines.length];
for (int i = 0; i < lines.length; i++){
String[] pieces = split(lines[i], ",");
if (pieces.length == 5){
records[recordCount] = new Record(pieces);
recordCount++;
}
}
if (recordCount != records.length){
records = (Record[]) subset(records, 0, recordCount);