Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: Using for loop to read in data from text file using Scanner class

    Sorry, images are hard to work with. You can't copy text from an image.
    Copy and paste here the full text of the console from when the program is executed.

    I'm done for tonight. Back tomorrow.
  2. Re: Using for loop to read in data from text file using Scanner class

    It's important to know what was being read when the error happened so you can change the code to handle the problem. Not copying and pasting here all that was printed just makes the debugging process...
  3. Re: Using for loop to read in data from text file using Scanner class

    What was the last thing printed before the error?
    How many numbers were printed before the error?
    What was being read when the error happened?
    Was it a numeric value or a String?
  4. Re: Using for loop to read in data from text file using Scanner class

    That is what is needed to see where the error is. The last thing printed tells you what was being read when the error happens.
  5. Re: Using for loop to read in data from text file using Scanner class

    I look at a lot of posts and don't remember. It makes it easier if the message is printed or the post# to look at is posted.

    Is Only that one line is the full text of the console???? Normal...
  6. Re: Using for loop to read in data from text file using Scanner class

    Please post the full text of the error message.

    Copy the full contents of the console and paste it including the debug print out and the error message.
  7. Re: Using for loop to read in data from text file using Scanner class

    Have you fixed the error?
  8. Re: Using for loop to read in data from text file using Scanner class

    Have you done this yet?
    Describe what data is on a line and say where that data should be saved.
    When you can describe where each part of the data goes, then work on writing the code to do it.
    ...
  9. Re: Using for loop to read in data from text file using Scanner class

    Start by making a loop that reads the lines and prints them.

    When that works, work on how to parse the data in the line.
    Describe what data is on a line and say where that data should be saved....
  10. Re: Using for loop to read in data from text file using Scanner class

    That loop doesn't read a line, it reads tokens.

    If you read a line first and then parse that line, you will have better control over what happens.
    You described the lines in the file as having...
  11. Re: Using for loop to read in data from text file using Scanner class

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve formatting.

    Where is the loop that reads the lines and prints them out?

    Does that part...
  12. Re: Using for loop to read in data from text file using Scanner class

    write the code in simple steps.
    First make a loop and in the loop read a line and print it
    continue until all the lines have been read and printed.
    When that works, then worry about how to parse...
Results 1 to 12 of 12