EDIT for further readers: the problem was that my input file was corrupted.
I don\'t understand what I\'m doing wrong :
I was using this cod
Try to use r.hasNext() instead of r.hasNextLine():
while(r.hasNext()) { scan = r.next();