Export data

Discussion of the Meteohub software package

Moderator: Mattk

Post Reply
User avatar
HeinrichH
Gold Boarder
Gold Boarder
Posts: 187
Joined: Sun Jan 04, 2009 6:27 pm
Location: Emmen-Netherlands / Panoias-Portugal
Contact:

Export data

Post by HeinrichH »

Is there a possibility to export data to a .csv file?
I want to export data from specific time periods to excel.

Thanks in advance
Checking the remote....
User avatar
HeinrichH
Gold Boarder
Gold Boarder
Posts: 187
Joined: Sun Jan 04, 2009 6:27 pm
Location: Emmen-Netherlands / Panoias-Portugal
Contact:

Re:Export data

Post by HeinrichH »

Nobody who can give me a tip??
Checking the remote....
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Export data

Post by skyewright »

A copy of the raw data files could be read by excel as space delimited text.

However you might prefer something like using eithed the WSWIN or WD exports, then reading the files that they produce?

David
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Export data

Post by Chill »

As skyewright said you can export to Excel.

I post here a few lines that may help you in order to read any of the weatehr files, obviously changing what is needed in each one:

Application.EnableCancelKey = xlDisabled
Application.EnableEvents = False
Sheets("STAT").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Sw = 100
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.yourweb.net/web2/datafolder/all-sensors.xml", Destination:=Range("A60"))
'.Name = "all-sensors"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 10
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
.Delete
End With
ActiveWorkbook.Names("lVAL").Delete
ActiveWorkbook.Names.Add Name:="lVAL", RefersTo:="=STAT!" & Range(Range("A60"), Range("A12000").End(xlUp)).Address

You will need to change
www.yourweb.net/web2/datafolder to the exact URL in your case.

This is working fine in
http://www.telefonica.net/web2/vilacard ... nallet.xls

You would need to replace the smiley with " ) . without spaces

HTH,
Chill
User avatar
HeinrichH
Gold Boarder
Gold Boarder
Posts: 187
Joined: Sun Jan 04, 2009 6:27 pm
Location: Emmen-Netherlands / Panoias-Portugal
Contact:

Re:Export data

Post by HeinrichH »

Thanks guys, no I have some thing to start
Checking the remote....
dcspicer
Senior Boarder
Senior Boarder
Posts: 46
Joined: Sun Feb 08, 2009 7:09 pm

Re:Export data

Post by dcspicer »

I'm thinking about doing something like this, can you tell me if this code is for excel or another program?

Dave
dcspicer
Senior Boarder
Senior Boarder
Posts: 46
Joined: Sun Feb 08, 2009 7:09 pm

Re:Export data

Post by dcspicer »

Hi there Chill. I took a look at your excel spreadsheet and I really like it. I'm wanting to make something like that for myself, but do not have a clue on where to start. Can you steer me in the right direction?

Thanks
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Export data

Post by Chill »

dcspicer wrote: Can you steer me in the right direction?
Thanks
Sure! You may use my Excel as it is, so you can set English language as default among (Catalan/Spanish/English)...

But if you're aiming to make your own, what exactly do you want to know?

Overall what I did is:

Read files:
- meteoclimatic.txt
- rain0-day1
- th0-day1
- thb0-day1
- wind0-day1
- all-sensors.xml

Store each one of them in a different range in Excel sheet.

Compute needed data

Display convenient results


Of course you can do it in several ways. Now I'm trying to learn PHP which may be much better (or other languages).

I used Excel as a workaround while I'm able to make it the right way...


HTH,
Regards,
dcspicer
Senior Boarder
Senior Boarder
Posts: 46
Joined: Sun Feb 08, 2009 7:09 pm

Re:Export data

Post by dcspicer »

Where on the server are these files kept?
I have found all except meteoclimatic.txt file.


- meteoclimatic.txt
- rain0-day1
- th0-day1
- thb0-day1
- wind0-day1
- all-sensors.xml
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Export data

Post by Chill »

Well, actually I peek meteoclimatic.txt file from my web server, not from my meteohub server.

This file is created when you want to export meteohub data to meteoclimatic weather network (It may be a similar one for the network you use).

Probably you won't use this file.

In all-sensors.xml you may find all the updated info you need.

Chill
dcspicer
Senior Boarder
Senior Boarder
Posts: 46
Joined: Sun Feb 08, 2009 7:09 pm

Re:Export data

Post by dcspicer »

ok So I finally started working on my excel spreadsheet and started to import the data. I'm having a little bit of a problem decoding the data. From the Rain0-Day1 file here is just a quick line that I copied

20090404000000 0.0 0 0.7 4.90 1

I know that the first part of the numbers is the date. But I do not have a clue on what the other columns mean.

Thanks
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Export data

Post by Chill »

Just download and READ meteohub manual from Downloads section http://www.meteohub.de/joomla/index.php ... &Itemid=29

You'll find what the data mean.

Chill
Post Reply