IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

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.
User avatar
jpsc
Posts: 163
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
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 RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

User avatar
mcrossley
Posts: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch 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.

User avatar
jpsc
Posts: 163
Joined: Tue Aug 23, 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
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 RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 3 guests