// assign locale as US to recognize double numbers in a string
scanner.useLocale(Locale.US);
William Nerem wrote:Shouldn't... Bob 3.4000 Richardson
System.out.print(lineScanner.next() + " ");
lineScanner.next();
System.out.print(lineScanner.next() + " ");
Print Bob Richardson? Why doesn't lineScanner.next() work in the loop with doubles?
William Nerem wrote:Anybody have any advice, I'm drowning here lol....
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Scanner lineScanner = new Scanner(line);
while (lineScanner.hasNextDouble()){
System.out.print(lineScanner.next() + " " + "\n");
Ramesh-X
William Nerem wrote:There is where my debugging stops me, it told me source not found? So it printed the first line, 1880, and it stops at Bob...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
William Nerem wrote:I'm not there yet because I have to find a way to break the while loop after I find the first 2 names while avoiding those stupid doubles.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Everybody's invited. Even this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|