I have a csv file that goes like this
Mike,Smith
Scuba,Steve
John,Doe
And java code that goes like this:
Scanner file=new Scanner(new File("input.txt"));
file.useDelimiter(",");
while (file.hasNext()){
String s1=file.next();
String s2=file.next();
System.out.println(s1+" "+s2);
}
file.close();
I get as output:
Mike Smith
Scuba
Steve
John Doe
I don't understand what could possibly make this work on the first two names but not the middle one