Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8985109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:15:38+00:00 2026-06-15T21:15:38+00:00

Alright, so basically, I am trying to write a simple program. The purpose is

  • 0

Alright, so basically, I am trying to write a simple program. The purpose is that it reads a file (the file is a set of numbers that would fill a 401 by 401 table) and then writes the data into an array and prints the array to the console. This is going ot be used later to find specific numbers, so like I will write code to find the highest and lowest numbers in the array etc. I don’t know how yet, but I haven’t got the program working yet. Every time I run this program, the exact error I get is as follows.

Exception in thread “main” java.lang.NumberFormatException: For input string: “363.0 360.0 354.0 349.0 343.0 339.0 333.0 319.0 324.0 325.0 324.0 317.0 317.0 322.0 322.0 320.0 315.0 314.0 313.0 311.0 309.0 308.0 315.0 320.0 326.0 332.0 336.0 341.0 346.0 350.0 353.0 353.0 352.0 351.0 352.0 353.0 351.0 350.0 346.0 339.0 338.0 349.0 354.0 357.0 360.0 366.0 371.0 377.0 383.0 387.0 393.0 398.0 402.0 409.0 414.0 419.0 425.0 432.0 439.0 442.0 444.0 446.0 448.0 450.0 453.0 457.0 460.0 460.0 462.0 464.0 465.0 466.0 467.0 467.0 469.0 470.0 471.0 470.0 470.0 470.0 470.0 477.0 479.0 480.0 486.0 490.0 492.0 495.0 497.0 496.0 499.0 499.0 500.0 500.0 499.0 499.0 499.0 500.0 500.0 497.0 494.0 491.0 488.0 487.0 485.0 490.0 490.0 488.0 484.0 482.0 481.0 478.0 474.0 471.0 466.0 461.0 454.0 449.0 443.0 436.0 432.0 422.0 410.0 397.0 389.0 381.0 375.0 365.0 340.0 318.0 289.0 283.0 276.0 266.0 255.0 241.0 235.0 233.0 234.0 235.0 235.0 239.0 257.0 281.0 302.0 321.0 330.0 337.0 354.0 373.0 383.0 389.0 401.0 410.0 413.0 403.0 389.0 381.0 373.0 363.0 351.0 343.0 335.0 328.0 322.0 314.0 306.0 298.0 293.0 285.0 275.0 270.0 276.0 283.0 286.0 286.0 285.0 283.0 283.0 283.0 279.0 274.0 270.0 264.0 255.0 245.0 239.0 238.0 238.0 239.0 240.0 249.0 256.0 262.0 268.0 272.0 275.0 276.0 275.0 273.0 271.0 269.0 269.0 271.0 274.0 276.0 279.0 283.0 289.0 293.0 294.0 295.0 295.0 297.0 307.0 312.0 314.0 314.0 314.0 313.0 312.0 310.0 307.0 305.0 304.0 303.0 304.0 299.0 291.0 308.0 325.0 335.0 344.0 351.0 358.0 361.0 366.0 370.0 379.0 382.0 386.0 389.0 391.0 391.0 390.0 390.0 393.0 395.0 397.0 402.0 408.0 412.0 413.0 414.0 415.0 415.0 416.0 416.0 416.0 415.0 415.0 414.0 413.0 411.0 410.0 408.0 407.0 407.0 406.0 404.0 402.0 400.0 394.0 375.0 379.0 390.0 394.0 397.0 397.0 397.0 397.0 402.0 405.0 407.0 407.0 412.0 417.0 423.0 428.0 441.0 448.0 451.0 453.0 457.0 458.0 459.0 460.0 460.0 460.0 458.0 456.0 455.0 454.0 455.0 455.0 455.0 454.0 452.0 452.0 451.0 450.0 450.0 450.0 450.0 447.0 442.0 440.0 437.0 436.0 436.0 437.0 437.0 437.0 436.0 434.0 429.0 427.0 425.0 422.0 412.0 410.0 415.0 415.0 414.0 413.0 413.0 414.0 411.0 410.0 409.0 408.0 406.0 404.0 402.0 400.0 398.0 395.0 393.0 392.0 389.0 387.0 385.0 384.0 380.0 377.0 376.0 375.0 374.0 372.0 370.0 369.0 367.0 365.0 362.0 355.0 346.0 340.0 334.0 331.0 331.0 330.0 327.0 323.0 322.0 319.0 316.0 315.0 310.0 297.0 289.0 280.0 274.0 274.0 282.0 301.0 320.0 328.0 344.0 352.0 351.0 350.0 346.0 341.0 338.0 333.0 329.0 323.0 318.0 312.0 308.0 304.0”
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at MultiArray.main(MultiArray.java:19)

Now, here is the code for my program.

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;  //importing tools

public class MultiArray {
    public static void main(String[] args)throws IOException {

        //variables
        int rows = 401;
        int columns = 401;
        String file = "dmt.asc";

        double dmtData[][] = new double[rows][columns];  //array

        BufferedReader Reader = new BufferedReader(new FileReader(file)); //read the file

        //split the numbers and write to array
        for(int i = 0; i < rows; i++){
            String rowArray [] = Reader.readLine().split("\t");
            for(int j = 0; j < columns; j++){
                dmtData[i][j] = Double.parseDouble(rowArray[j]);
            }
        }

        Reader.close();  //close the reader and the file

        //print out the array
        for(int i = 0; i < rows; i++){
            for(int j = 0; j < columns; j++){
                System.out.println(dmtData[i][j]);
            }
        }

        //code here to find highest number
        System.out.println("The highest peak in this area is: ");

        //code here to find lowest number
        System.out.println("The lowest dip in this area is: ");

    }

}

Thanks for any help, I promise once I understand java I’ll do my best to answer questions on here 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:15:39+00:00Added an answer on June 15, 2026 at 9:15 pm

    If your rowArray[j] is returning a proper parsable double value, then you should not have any trouble in your code. See your file whether its seperated by \t (tab) and not jus ” “(whitespace).
    Cos I did the same mistake while trying to execute your code and check getting the same exception as told by you..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright so I am trying to basically take what's in $row['cardid'] and set it
Alright so my question is, how can I make a program that basically executes
Alright, so I've been trying to implement a simple binary search tree that uses
Alright so i need to open a .txt file that will be created in
Alright, here I am again trying to write code from scratch and I can't
Alright, so basically what I'm trying to do is use the value (which in
I have a 3 file program, basically teaching myself c++. I have an issue.
I'm trying to create a simple site. Basically it has one Controller Home controller.
Basically exactly what the title says. I would like to update the text that
I have a very simple script that monitors a file transfer progress, comparing its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.