Search:

Type: Posts; User: Norm

Search: Search took 0.21 seconds.

  1. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    The byte pattern in the before printout:
    shows two ? at the start of the line followed by alternating chars and "spaces".
    I recognize this as the pattern for a UTF16 file.

    Here is the printout...
  2. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    Does the input txt file use UTF16 encoding?
    If so, the constructor for the Scanner class needs to be told that:

    Scanner scnr = new Scanner(is, "UTF16"); //<<<<<<< needs...
  3. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    What are these values shown in the printout?
    47
    0
    0
    The print statement should have a small String before the value that is printed so you know what it is the value of. Like you did here:...
  4. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    Where is the col=0 value printed? What was the value in line?
    Add this statement to the code after the statement that assigns a value to line:


    System.out.println("col="+ col + ", line=" +...
  5. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    Did you print out the values of line and col as I suggested?
    What was printed?


    Note: a null value is NOT the same as an empty String: ""
  6. Replies
    10
    Views
    1,099

    [SOLVED] Re: .txt file won't convert to ints

    What are the values in the variables used in line 86? What is in line and what is in col?
    Add a print statement before line 86 that prints out those two variables' values.

    The error message says...
Results 1 to 6 of 6