Question

I need help parsing a large text file in order to create a map using Java....

I need help parsing a large text file in order to create a map using Java. I have a text file named weather_report.txt which is filled with hundreds of different indexes. For example: one line is "POMONA SUNNY 49 29 46 NE3 30.46F". There are a few hundred more indexes like that line with different values in the text file and they are not delimited by commas but instead by spaces. Therefore, in this list of indexes we only care about the location (Pomona) and the temperature (30.46F). All the other information in this index (Sunny 49 29 46 NE3) are irrelevant.

I need to print out the pairs of location and temperature so that the lowest temperature values are sorted first and that the results are outputted via PrintStream function as an external txt file named weatheroutput.txt. How would this be coded in Java?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,

I am not able to paste the code. showing some loading error.

Please see the screenshots of code.

import java.io.BufferedReader import java.io.FileReader: import java.io. IOException; public class Weather static String [ lo//To sort array public static void sortArray) i for (int į = 0; ǐ < tempArray. length; 1++) { for (int j = 1 + 1; j < tempArr

Add a comment
Know the answer?
Add Answer to:
I need help parsing a large text file in order to create a map using Java....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please answer it in a java console application form (java GUI). Least Square Lines Equation- Text File /O Suppose we ha...

    please answer it in a java console application form (java GUI). Least Square Lines Equation- Text File /O Suppose we have a text file (which I supplied named data.txt) that has the following table: Temperature (celsius) Resistance (ohms) 20.0 761 31.5 817 50.0 874 71.8 917 91.3 1018 Write a Java console applicatlon, that does the following: 1. Prompt the user for the name of the text file 2. Opens the text file and reads in the ordered pair data...

  • Hi! 1. I need some help with sorting string in a text file. My goal is...

    Hi! 1. I need some help with sorting string in a text file. My goal is to 1 shift left strings for string.length time. I was able to do that successfully. However, I am also trying to sort, using insertion sort , the resulting shifts. I store all shifts in a vector (or is it better to use an array?!) , and try to sort them that way, but my output is just the shifted strings but not sorted. Can...

  • I need help using python ( spyder) only use files , loops if needed is statement do not use , def...

    i need help using python ( spyder) only use files , loops if needed is statement do not use , def function or any other. Exercise 1: Daily temperature is recorded for some weeks in files (templ.txt", temp2.txt, and temp3.txt; provided in the MOODLE). The first line contains number of weeks and the rest of the lines each represent the week number followed by temperature on the seven days of that week (see samples input files below). Write a python...

  • Using Java; Consider the following text file format. Ruminant Shaman 30 Elentriel Shaman 70 Aelkine Druid...

    Using Java; Consider the following text file format. Ruminant Shaman 30 Elentriel Shaman 70 Aelkine Druid 29 Barbatus Druid 70 Ukaimar Mage 47 Mariko Priest 33 Farmbuyer Priest 70 Valefar Warlock 42 Teslar Paladin 64 Nerdsbane Hunter 12 We wish to store information regarding several characters in a video game. Each character has a name, and a class, and a level. This information is repeated, 3 lines per character, for any number of characters. To simplify processing, the very first...

  • Hi, I need help for solving Linux question. . 1.Using the proper text editor, create a...

    Hi, I need help for solving Linux question. . 1.Using the proper text editor, create a shell file called by (your name), your enrollment number, your program and the courses you study. Use the appropriate variables and display the above to the standard output (screen). . 2. Write A Shell Script to perform the following: Display the files and directories Print the date in 24 hour format Display the System id Display the current working directory Print the status of...

  • Hello Guys. I need help with this its in java In this project you will implement...

    Hello Guys. I need help with this its in java In this project you will implement a Java program that will print several shapes and patterns according to uses input. This program will allow the use to select the type (say, rectangle, triangle, or diamond), the size and the fill character for a shape. All operations will be performed based on the user input which will respond to a dynamic menu that will be presented. Specifically, the menu will guide...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

  • Need help starting from question 9. I have tried multiple codes but the program says it is incorrect. Case Problem 1 Da...

    Need help starting from question 9. I have tried multiple codes but the program says it is incorrect. Case Problem 1 Data Files needed for this Case Problem: mi pricing_txt.html, mi_tables_txt.css, 2 CSS files, 3 PNG files, 1 TXT file, 1 TTF file, 1 WOFF file 0 Marlin Internet Luis Amador manages the website for Marlin Internet, an Internet service provider located in Crystal River, Florida. You have recently been hired to assist in the redesign of the company's website....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT