Sandaysoft

Support forum for Cumulus weather station software
It is currently Tue May 21, 2013 1:04 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Convert WD files into Cumulus data files.
PostPosted: Fri Mar 25, 2011 4:08 pm 
Offline

Joined: Fri Mar 25, 2011 3:38 pm
Posts: 7
Location: Tonbridge, Kent
Weather Station: Vantage Vue
Operating System: XP SP3
I was just wondering if anybody had done this. I am taking delivery of a Vantage Vue next week, and have been running Weather Display for years. But I have got fed up with it. It is overly complicated, I just want to store the records and be able to view them.
So I will be looking to convert the files to Cumulus data files and wondered if there where any hints or tips.

Thanks
Warren


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Fri Mar 25, 2011 5:02 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17559
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
I did look into this briefly a long time ago, but I was unable to find a specification of the WD file format anywhere, so I gave up. I'm not aware of anyone else having done anything.

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Fri Mar 25, 2011 9:19 pm 
Offline

Joined: Fri Mar 25, 2011 3:38 pm
Posts: 7
Location: Tonbridge, Kent
Weather Station: Vantage Vue
Operating System: XP SP3
OK, well when I have a little time I shall have a look at the WD files, and possibly write a little script to convert them.


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Sat Mar 26, 2011 12:35 am 
Offline

Joined: Tue Aug 03, 2010 6:23 am
Posts: 484
Location: Ferntree Gully, VIC, Oz
Weather Station: WM918
Operating System: Win Server 2008 R2
WD creates log files on a monthly basis - filename format is mmyyyylg.txt where mm is the month number but NOT zero padded - so Jan 2008 would be 12008lg.txt. These files should be in the WD logfiles directory and the first line contains the field names for the data (just about every weather software package except Cumulus does this btw....)

The fields are space or tab delimited (can't recall which off hand) and, the other issue, the day and month numbers are also not zero padded - so Jan is 1 and Nov 11, which means you can'tprocess them based simply on column numbers.

You can import them into Excel and then export them as CSV files for easier processing - but IIRC you can't just import them into a Cumulus log file - you would need a seperate SQL database or some programs to process the TXT files as you want them displayed.

There is also a CSV file generated -= file name is mmyyyylgcsv.csv - again, the first record contains the field names.

I had my WD records going back to 2002 and have been able to process them without any difficulty.

_________________
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Fri Apr 01, 2011 4:18 pm 
Offline

Joined: Fri Mar 25, 2011 3:38 pm
Posts: 7
Location: Tonbridge, Kent
Weather Station: Vantage Vue
Operating System: XP SP3
OK I had a little spare time this afternoon, so have written a small VBS script to convert the monthly WD files to Cumulus monthly files, Just need to write one now to create the dayfile.txt file from the WD dailylog.txt. Will let you know when it is done. Am I right in thinking that if I place these files within the datafiles directory I can update all the records in Cumulus ?


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Fri Apr 01, 2011 4:27 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17559
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
warrenb wrote:
Am I right in thinking that if I place these files within the datafiles directory I can update all the records in Cumulus ?

1.9.1 has a facility to trawl the data logs to fetch the all-time records, and this month's and this year's records, or at least as best it can from the data that's available.

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Sat Apr 02, 2011 4:05 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
warrenb wrote:
OK I had a little spare time this afternoon, so have written a small VBS script to convert the monthly WD files to Cumulus monthly files...
Warren, once you have some time, could you post the code for that VBScript - I would like to find out if I could write a PHP script instead as I have never used a VBScript editor before (nor do I know if there is such an editor on my computer)... ;)


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Sat Apr 02, 2011 8:33 am 
Offline

Joined: Fri Mar 25, 2011 3:38 pm
Posts: 7
Location: Tonbridge, Kent
Weather Station: Vantage Vue
Operating System: XP SP3
A VBS script is a standard VB script saved to a file filename.vbs, this is executable by just clicking on it. I have used notepad to script this.


dim oFso,ofile,ostream,oOutfile,txtline,newliner

set ofso=createobject("scripting.filesystemobject")
set ofile=ofso.getfile("22011lg.txt")
set ostream=ofile.openastextstream(1,-2)
set oOutfile=ofso.createtextfile("Feb11log.txt")
do while not ostream.atendofstream
txtline=split(ostream.readline(),";")
if len(txtline(0))=1 then
newliner="0"+txtline(0)+"/"
else
newliner=txtline(0)+"/"
end if
if len(txtline(1))=1 then
newliner=newliner+"0"+txtline(1)+"/"
else
newliner=newliner+txtline(1)+"/"
end if
newliner=newliner+right(txtline(2),2)
if len(txtline(3))=1 then
newliner=newliner+",0"+txtline(3)
else
newliner=newliner+","+txtline(3)
end if
if len(txtline(4))=1 then
newliner=newliner+":0"+txtline(4)
else
newliner=newliner+":"+txtline(4)
end if
newliner=newliner+","+txtline(5)
newliner=newliner+","+txtline(6)
newliner=newliner+","+txtline(7)
newliner=newliner+","+txtline(9)
newliner=newliner+","+txtline(10)
newliner=newliner+","+txtline(11)
newliner=newliner+","+txtline(12)
newliner=newliner+","+txtline(13)
newliner=newliner+","+txtline(8)
newliner=newliner+","+txtline(15)
newliner=newliner+",0.0"
newliner=newliner+",0.0"
newliner=newliner+",0.0"
newliner=newliner+",0.0"
newliner=newliner+","+txtline(16)
newliner=newliner+",0.0"
newliner=newliner+",0.0"
oOutfile.writeline(newliner)
loop


I have only done it for one file so far, but it seems to have work, for when I went into monthly records it did give me the correct information for February this year. As you can see there is some information in the Cumulus file which isn't in the WD file, so have filled with 0.0.


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Sat Apr 02, 2011 8:43 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Warren, thank you for the VBScript - I must now find some VB documentation to understand what the script does... ;)


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Sat Apr 02, 2011 10:04 am 
Offline

Joined: Fri Mar 25, 2011 3:38 pm
Posts: 7
Location: Tonbridge, Kent
Weather Station: Vantage Vue
Operating System: XP SP3
Hi there

I also edited the WD files before running through this script. I removed all spaces and replaced with ";" and also removed any ";" from the start of lines.

I would have done this with code but I work with VI so did it in that.


Top
 Profile  
 
 Post subject: Re: Convert WD files into Cumulus data files.
PostPosted: Tue Apr 05, 2011 1:12 am 
Offline

Joined: Wed Dec 17, 2008 12:01 am
Posts: 31
Location: USA
Weather Station: Davis
Operating System: W7
If you have solar WD stores that data in a separate log, mmyyyyvantagelog.txt.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group