Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Maria Filonczuk wrote:
I am guessing by List you mean to use ArrayList?
Maria Filonczuk wrote:
I hope you are around to help me some more tonight. thank you!!
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Yes, but what Cambell is trying to find out is: does all the data in a line represent something? For example, is it something like METAR data?Maria Filonczuk wrote:Yes the numerical values have some significance. For example the data in columns 8 and 9 are actually latitude and longitude in radians and I will convert it to degrees. Column 10 is height in meters and I need to convert it altitude in feet. I do know those conversions, although in the initial post I just put some simple numbers in.
A very good idea. Don't get distracted by other stuff before you've got the input working.I am eventually going to need to average the data say every 10 lines and then print in the output file, but I am trying to do these initial steps first.
Ah, so where do you get that from, or is it a constant?It will be all double data I believe except I have to add an identifier string to the first and second column of each row so the data can be read by a weather model.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Maria Filonczuk wrote:I have looked at parsing the data by String with the split method. I don't know how to call just the columns I need. I may have 30 or more columns of data but only want to call 10 of those and perform an operation on.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Maria Filonczuk wrote:Thank you Winston. I understand what you just showed me. My file is just text with data in it.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Maria Filonczuk wrote:I have always put the main method first. But as I see in your code below and have seen on other projects, some put it at the end. Just wondering what the value in that is, or is it more necessary when you have several classes?
Second, the error "non-static variable this cannot be referenced from a static context" is throwing me for a loop. I know it has to do with declaring my variables correctly in my classes. And this probably goes hand in hand with first question above.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
The City calls upon her steadfast protectors. Now for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|