But, what I really want is to get it to skip the 1st 2nd and 3rd lines and read the 4th line beginning 0 1234. I have tried all sorts of combinations of while(myScanner.hasNext()){}, while(myScanner.hasNextLine()), myScanner.nextInt(), myScanner.next(), and it happily reads either one line or all five lines (the %n at the end of the 4th line means there is a 5th line with nothing in).
I might use two Scanners, use one to go
. . . but I think there must be a more elegant way to do it. I don't want to go back to the old J1.4 way of using FileStreams or whatever they were called, because then I have to call Integer.parseInt() for each of the numbers, and scanner2.nextInt() is so much neater.
Any suggestions???
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
I didn't recognize the National Insurance Number, but then again cricket doesn't make sense to me either. Still, this may be what you're looking for:
There is no emoticon for what I am feeling!
Jody Brown
Ranch Hand
Joined: Nov 09, 2005
Posts: 43
posted
0
A National Insurance Number is the U.K. equivalent of a Social Security Number in the U.S.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
4
posted
0
Yes, that probably is what I am looking for, Mr Albreachtsen. It is obvious once you think of it.
Thank you.
Allion Salvador
Ranch Hand
Joined: Nov 15, 2005
Posts: 49
posted
0
YOU SPELLED HIS NAME WRONG!!!
Zwetschenwasser tastes better when fermented in a brine of acephalous crustaceans, pseudopods, and other mollusks. It goes quite well with gnocchi and mole.
Allion Salvador
Ranch Hand
Joined: Nov 15, 2005
Posts: 49
posted
0
Oh, and they are called "FileInputStream" and I think they are fine!
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
Originally posted by Allion Salvador: YOU SPELLED HIS NAME WRONG!!!
Jeff Albertson wrote:I didn't recognize the National Insurance Number, but then again cricket doesn't make sense to me either.
Still, this may be what you're looking for:
Hi Jeff,
Old thread but this is exacly what I wanted, except one small detail and I can't figure it out and that is how do I get the 3rd from last line also.
I have before = penultimate and then penultimate = scanner.nextLine(); also but it does not work :-(