Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Editing CMX logs using Windows Cumulus 1

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
jpsc
Posts: 152
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Oregon Scientific WMR180
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Editing CMX logs using Windows Cumulus 1

Postby jpsc » Tue Oct 24, 2017 2:32 pm

My logs and history are a mess due to a malfunctioning Fine Offset station.

I would like to get rid of all the zeros and spikes to make a clean history.

Just supposing I stop CMX and duplicate the data directory into my old Cumulus setup on Windows. Using select-a-graph I can look at each month and easily see what is wrong. I will be able to use a text editor to cut out great swathes of corrupt history from the logs. I then use the Cumulus editor to fix up the monthly, yearly and alltime summaries. I estimate that 6 months of the past two years need drastic surgery, but I could run over all of them to make sure the monthly files are consistent.

The fly in the ointment is the date format difference in the ini files; the monthly logs are compatible between CMX and C1 - possibly needing a line ending change.

Changing the date format in the ini files is simple, a sed script will do it. Changing back is also not a problem.

After all the files are edited, it is just a matter of copying them back over the original CMX files (NB taking backups first) and restarting CMX.

Can anyone see a flaw in this approach? Are there any other files that need to be changed? (all the ini files in the data directory, and cumulus.ini itself)

ToWindowsDates.sed

Code: Select all

s,([0-9]{4})-([0-9]{2})-([0-9]{2})T,\3/\2/\1 ,g

ToUnixDates.sed

Code: Select all

s,([0-9]{2})/([0-9]{2})/([0-9]{4}) ,\3-\2-\1T,g

Batch file to run on Windows:

Code: Select all

for %%i in ("*.ini") do (
  sed -r -i -f ToWindowsDates.sed %%i
)

Has anyone tried anything like this?
John Cooper

Cumulus MX on RPi
http://weather.mountpleasanthouse.uk served by RPi
http://www.wunderground.com/personal-weather-station/dashboard?ID=IHOARWIT2
findu EW8125
metoffice WOW 935926001
WeatherCloud d1062873366
PWS EW8125
Awekas 12872

User avatar
mcrossley
Posts: 4980
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Editing CMX logs using Windows Cumulus 1

Postby mcrossley » Tue Oct 24, 2017 6:29 pm

I have edited MX files in Cumulus 1 before without any issue, but my date formats are the same so it was easy.

jpsc
Posts: 152
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Oregon Scientific WMR180
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: Editing CMX logs using Windows Cumulus 1

Postby jpsc » Tue Oct 24, 2017 10:06 pm

Thanks, I'll give it a go
John Cooper

Cumulus MX on RPi
http://weather.mountpleasanthouse.uk served by RPi
http://www.wunderground.com/personal-weather-station/dashboard?ID=IHOARWIT2
findu EW8125
metoffice WOW 935926001
WeatherCloud d1062873366
PWS EW8125
Awekas 12872


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 2 guests