Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    What is the last item read before the NoSuchElementException?
    What is in the file after the last thing that was read? The print outs of everything right after it was read will show you.

    Which...
  2. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    Why is that? How does the code find and read from the file?
  3. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    That error says that there is no data to read.

    To see where the program is reading in the file, add a println() statement that prints out everything that is read. If you look at the last thing...
  4. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    At line 112 the code calls the next() method when there is no data to be read. Use the Scanner class's hasNext method to check that there is data BEFORE trying to read data that is not there.
  5. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    If you are getting errors, you need to copy and post the full text of the error message.
  6. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    There needs to be a section of the code that is executed after the code determines the type of the data that follows.
    How many lines of data are for the data type found?
    Is there a line that...
  7. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    The code should use the results of the "set type of data" step to know how to process the following lines.
    The else statement ignores those results.

    Rework the logic so it uses the results of...
  8. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    The else statements are executed when none of the above if statements are true.
    Where does the code handle the lines for the type set by the next to last step? "set type of data"
  9. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    What does the last step in the else do: deal correctly?
    Where does the code handle the lines for the type set by the next to last step? "set type of data"
  10. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    Try writing what you think should work and see what happens. When you have problems you can't figure out, post the code and your questions.
  11. Replies
    21
    Views
    1,286

    Re: Recording data , so you know whats next

    Can you explain what problem you are having detecting what type of data is next? Post a sample of the input file and explain the contents/format of what is on each line in the file.


    else...
Results 1 to 11 of 11