Reading multiple integers in multiple lines
|Added at||2016-12-30 11:12|
I am currently writing my Bachelor's thesis in graph theory and use the java scanner to convert a txt file with edges into my Java class graph. My txt file looks like this:
The ints are ordered as: source vertex, sink vertex, cost, capacity.
My Code looks like:
I tried to scan each line in a String and then scan the String into my Variables. It always throws a "NoLineFound" Exception in the first line of the for loop and if I try it with outputing the lines I get none. But when I disable the second scanner and try again I get all lines in the ouput but at the end still a "NoLineFound" Exception.
I checked my txt File and the last line doesn't have a UTF8 line ending, but I don't know how to give it one.