Page 1 of 1

Export data

Posted: Fri Jul 17, 2009 7:29 pm
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

Re:Export data

Posted: Fri Jul 24, 2009 9:44 am
by HeinrichH
Nobody who can give me a tip??

Re:Export data

Posted: Fri Jul 24, 2009 5:15 pm
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

Re:Export data

Posted: Fri Jul 24, 2009 7:09 pm
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

Re:Export data

Posted: Fri Jul 24, 2009 7:21 pm
by HeinrichH
Thanks guys, no I have some thing to start

Re:Export data

Posted: Sun Jul 26, 2009 6:01 am
by dcspicer
I'm thinking about doing something like this, can you tell me if this code is for excel or another program?

Dave

Re:Export data

Posted: Wed Aug 05, 2009 5:15 am
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

Re:Export data

Posted: Wed Aug 05, 2009 8:40 am
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,

Re:Export data

Posted: Thu Aug 06, 2009 5:08 am
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

Re:Export data

Posted: Thu Aug 06, 2009 8:34 am
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

Re:Export data

Posted: Fri Aug 07, 2009 5:57 am
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

Re:Export data

Posted: Fri Aug 07, 2009 8:02 am
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