I have a test.txt file with the following in it:
MapTile,1,256,false MapTile,9,291,false
no matter what way I try to read this file in java, the result is:
M a p T i l e , 1 , 2 5 6 , f a l s e M a p T i l e , 9 , 2 9 1 , f a l s e
String tokens[] = line.split("[,]"); //results in the following:
" M a p T i l e ", " 1 ", " 2 5 6 ", " f a l s e "
when the following is expected:
"MapTile", "1", "256", "false"
treating it to any method of removing all the white spaces fail, what exactly are these characters?
there is no way i can use the numbers or booleans in this (read as strings)
console says:
NumberFormatException: for input String: "2 5 6"
and goes on to specify the line where I try to
int num = Integer.parseInt(tokens[2]);
I have searched the net for hours on this.
Please help.