Page 1 of 1
Convert WD files into Cumulus data files.
Posted: Fri 25 Mar 2011 4:08 pm
by warrenb
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
Re: Convert WD files into Cumulus data files.
Posted: Fri 25 Mar 2011 5:02 pm
by steve
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.
Re: Convert WD files into Cumulus data files.
Posted: Fri 25 Mar 2011 9:19 pm
by warrenb
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.
Re: Convert WD files into Cumulus data files.
Posted: Sat 26 Mar 2011 12:35 am
by serowe
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.
Re: Convert WD files into Cumulus data files.
Posted: Fri 01 Apr 2011 4:18 pm
by warrenb
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 ?
Re: Convert WD files into Cumulus data files.
Posted: Fri 01 Apr 2011 4:27 pm
by steve
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.
Re: Convert WD files into Cumulus data files.
Posted: Sat 02 Apr 2011 4:05 am
by gemini06720
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)...

Re: Convert WD files into Cumulus data files.
Posted: Sat 02 Apr 2011 8:33 am
by warrenb
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.
Re: Convert WD files into Cumulus data files.
Posted: Sat 02 Apr 2011 8:43 am
by gemini06720
Warren, thank you for the VBScript - I must now find some VB documentation to understand what the script does...

Re: Convert WD files into Cumulus data files.
Posted: Sat 02 Apr 2011 10:04 am
by warrenb
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.
Re: Convert WD files into Cumulus data files.
Posted: Tue 05 Apr 2011 1:12 am
by sooty
If you have solar WD stores that data in a separate log, mmyyyyvantagelog.txt.
Re: Convert WD files into Cumulus data files.
Posted: Sat 08 Mar 2014 6:02 pm
by Red Raspberry
I have records from my WL that go back to 2002.
So all I need to do is export the monthly files to a new folder renaming 22011lg.txt to the current month I am exporting, then edit and run the vbs file from withing that folder?
Re: Convert WD files into Cumulus data files.
Posted: Sat 08 Mar 2014 6:24 pm
by MackerelSky
Red Raspberry wrote:I have records from my WL that go back to 2002.
So all I need to do is export the monthly files to a new folder renaming 22011lg.txt to the current month I am exporting, then edit and run the vbs file from withing that folder?
This is a thread for WD(Weather Display)
Try this one to convert your WL files
https://cumulus.hosiene.co.uk/viewtopic.p ... to+cumulus