473,513 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weather Prediction Program Help

To all who know C++,

Im working on a prog that will be able to predict the weather, its too
complicated to go into here, but I do need some help.

I need to grab all of the information in the file currdat.lst that is in
quotes and store them in variables. Sounds simple enough, right? This area
of my prog. is complete garbage, so I wont bother to post it.

For anyone interested in helping, the next line is line one of
currdat.lst
[header]
programm_name = "heavy weather"
programm_version = "Ver. 2.0 beta release"
file_name = "currdat.lst"
file_format_version = "ver. 1.0"

[time]
start = 3315854779
start_date_string = "Thu Jan 27 17:46:19 2005"
last_actualisation = 3315855694
last_actualisation_date_string = "Thu Jan 27 18:01:34 2005"
next_actualisation = 3315855754
next_actualisation_date_string = "Thu Jan 27 18:02:34 2005"

[weather_picture]
comment = "-1=not valid, 0=rain, 1=cloud, 2=sun"
number = 1

[weather_tendency]
comment_1 = "-1=not valid, 0=no change of air pressure"
comment_2 = " 1=air pressure rising, 2=air pressure falling"
number = 0

[indoor_temperature]
deg_C = "20.2"
deg_F = "68.3"

[outdoor_temperature]
deg_C = "-15.8"
deg_F = "3.5"

[indoor_humidity]
percent = "43"

[outdoor_humidity]
percent = "19"

[dewpoint]
deg_C = "OFL"
deg_F = "OFL"

[windchill]
deg_C = "-15.8"
deg_F = "3.5"

[wind_speed]
mps = "0.0"
kmh = "0.0"
mph = "0.0"
knt = "0.0"
bft = " 0"

[wind_direction]
deg = "22.5"
name = "NNE"

[rain_total]
mm = "0.0"
inch = "0.00"

[rain_24h]
mm = "0.0"
inch = "0.00"

[rain_1h]
mm = "0.0"
inch = "0.00"

[pressure_absolute]
hpa = "1017.5"
inHg = "30.04"

[pressure_relative]
hpa = "2748.1"
inHg = "81.15"

[storm_alarm]
comment = "-1=not valid, 0=storm alarm not activ, 1=storm alarm activ"
number = 0

Jul 23 '05 #1
3 2529
On Mon, 21 Feb 2005 16:10:49 -0500, "JamesLomuscio"
<ja***********@aol.com> wrote in comp.lang.c++:
To all who know C++,

Im working on a prog that will be able to predict the weather, its too
complicated to go into here, but I do need some help.
We'll be glad to help.
I need to grab all of the information in the file currdat.lst that is in
quotes and store them in variables. Sounds simple enough, right? This area
of my prog. is complete garbage, so I wont bother to post it.
If you don't show us your code, how can you expect us to offer you
advice on correcting it?
For anyone interested in helping, the next line is line one of
More than a few here would be interested in helping, but probably none
interested in writing your code for you.
currdat.lst
[header]
programm_name = "heavy weather"
programm_version = "Ver. 2.0 beta release"
file_name = "currdat.lst"
file_format_version = "ver. 1.0"


[snip]

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 23 '05 #2
On Mon, 21 Feb 2005 16:10:49 -0500, JamesLomuscio <ja***********@aol.com>
wrote:
To all who know C++,

Im working on a prog that will be able to predict the weather, its too
complicated to go into here, but I do need some help.

I need to grab all of the information in the file currdat.lst that is in
quotes and store them in variables. Sounds simple enough, right? This
area
of my prog. is complete garbage, so I wont bother to post it.

For anyone interested in helping, the next line is line one of
currdat.lst
[header]
programm_name = "heavy weather"
programm_version = "Ver. 2.0 beta release"
file_name = "currdat.lst"
file_format_version = "ver. 1.0"


[...]

where is the problem?
use std::ifstream, getline(), and parse the strings / lines you get.
for parsing, you may want to use the various std::string::find*()
methods...
Jul 23 '05 #3

"JamesLomuscio" <ja***********@aol.com> wrote in message
news:1b******************************@localhost.ta lkaboutprogramming.com...
To all who know C++,

Im working on a prog that will be able to predict the weather, its too
complicated to go into here, but I do need some help.

That's a pretty lofty goal! Especially considering that the most powerful
computers in the world are used for such tasks, and the code for such has
been developed over decades of painstaking research and analysis.
I need to grab all of the information in the file currdat.lst that is in
quotes and store them in variables. Sounds simple enough, right? This area
of my prog. is complete garbage, so I wont bother to post it.


Are you on the Windows platform? That data looks just like an INI file to
me. If so, there is functionality in the Windows API (and in the Visual C++
libs) specifically for reading INI files. If that's your platform+compiler,
check the VC+ docs or the Windows API docs, or ask in a windows-related
newsgroup. That'll probably be easier than writing the parsing code
yourself.

But if you want help with the parsing code, you need to make a stab at it
yourself, and come back here if/when you have language-related issues with
what you've written. If the code is complete garbage, then you probably
need to re-design it entirely, and then re-write it. Look into streams.
There are many examples of reading from streams which you can find via a
search of groups.google.com. (We're certainnly not going to re-write your
non-posted, garbage code for you!)

-Howard

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3515
by: news.microsoft.com | last post by:
In my engineering class we're discussing microprocessor branch predictors. Is it possible to write a Windows application (anything whatsoever) that would allow me see how branch prediction is done...
3
1957
by: sduncansca | last post by:
Hello We have been using the the National Weather Service webservice(http://www.weather.gov/xml/) for a while. A couple weeks ago they made some changes and moved the url of the...
3
11356
by: Neal | last post by:
VC++ VS 2003 I am currently finishing up a weather bug program that receives data from the weather.com weather feed, just need some finishing touches. The one issue I have run into seems to be...
9
3885
by: Boki | last post by:
Hi All, I am going to create a personal weather board. It is easy to show the picutre on website ( just link the picture to picturesbox's properties ) but I dont' know how to add some other...
1
2549
by: pmclinn | last post by:
I have the xml feed belowfrom this link: http://www.weather.gov/alerts/ct.rss I for the life of me can not get this data to format in a html table using client side scripting. Any help would be...
0
1587
by: jimb | last post by:
Looking for a simple view on the weather. Just learning the xml stuff. I would like to add to the the weather.com icon. Any help is appreciated. <html> <head> <body bgcolor="#000000"...
3
3811
by: dawnrager | last post by:
Hi, everyone. I'm having a really difficult time pasting in generated code from the Weather Channel for a weather sticker for my webpage. This was the code sent to me via email: <!-- cut and...
4
5366
by: Jake G | last post by:
Hi all, I am trying to get a current weather conditions feed working. Yahoo provides a free feed @ http://weather.yahooapis.com/forecastrss?p=XXXXX where XXXXX is a valid US zip code e.g....
2
2062
by: sandeep patil | last post by:
how to diplay the weather condiction on my webpage suppose i want to read weather from www.bbc.co.uk/weather.html how i can read it usin program
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.