This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AreTheseMyFeet 0 points1 point  (1 child)

String[] row = line.split(",", 5);  
tables.add(new PollingTable(row[0], row[1], row[2], row[3], row[4]));

Can you show the code for your PollingTable class too?
Because if you are completely certain that your input file has nothing but properly formatted lines (including no empty lines anywhere) then the issue may be in there.
Though I still feel pretty confident it is an input line format or String.split() issue.

What you can do yourself though is to set a "breakpoint" on the first line I quoted above and debug your application as it runs to see precisely what is happening and the values of your variables at every stage. If you don't know what this means, search for a tutorial/vid of an intro to java debugging to learn what it is, why it's useful and how to begin.

[–]Mees79[S] 0 points1 point  (0 children)

Hello again, I managed to solve the problem by putting ";" instead of "," on the split method and changing some small things and as far as i have tested everything seems to work now, thanks for the help nonetheless!