Amending dayfile: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
2,039 bytes added ,  12:27, 2 June 2021
m
no edit summary
mNo edit summary
Line 13: Line 13:


The most common problems with dayfile.txt are:
The most common problems with dayfile.txt are:
*(MX only) inconsistencies between lines i.e. one of following changes from one line to another
** either the date separator (character or characters between day of month, month, and year parts)
** or the decimal point or decimal comma (that separates the integer and decimal parts of real numbers)
*people see Cumulus giving error messages saying there is an error in a particular line (Cumulus only reports first error, there may be more)
*people see Cumulus giving error messages saying there is an error in a particular line (Cumulus only reports first error, there may be more)
*plots only show data for a subset of the lines in the file, because different lines have different formats for the dates
*plots only show data for a subset of the lines in the file, because different lines have different formats for the dates
*a Cumulus user (or an electrical fault) stops or starts the software close to rollover time, a Cumulus user upgrades the software close to rollover time, or another process interferes with Cumulus causing it to twice copy information from '''today.ini''' to '''dayfile.txt''' resulting in a duplicate line with same date (but incorrect content in one of the lines)
*a Cumulus user (or an electrical fault) stops or starts the software close to rollover time, a Cumulus user upgrades the software close to rollover time, or another process interferes with Cumulus causing it to twice copy information from '''today.ini''' to '''dayfile.txt''' resulting in a duplicate line with same date (but incorrect content in one of the lines)


Both errors generally relate to a mistake in the way a Cumulus user has edited the file, so now you understand the heading for this section! The editor within Cumulus can correct errors that relate to the content of value and time-stamp fields (one common error is to accidentally delete a field in an external editor, using the editor provided by Cumulus does ensure the right number of fields are stored). Unfortunately, the editor provide with MX does not validate any line you change there so it can introduce further errors.  However, the Cumulus MX editor cannot correct any errors in the date that identifies each line.
All errors generally relate to  
* Either using the same file, but moving between computers, without checking the locale settings
*Or a mistake in the way a Cumulus user has edited the file, perhaps because of editing the file using Microsoft Excel (and formatting the date column as a date not as text)!


This page also contains information about other ways in which you can amend the contents of this log.
==Validation by in-built editors==
 
Both  the legacy editor and the MX editor will ensure that the correct number of fields is stored (as defined at the release where you do editing) (one common error in an external editor is to accidentally add/delete a field).
 
The legacy editor does also validate individual fields for appropriate content (integer, real number, time-stamp).
 
Unfortunately, the editor provided with MX does not validate any fields.  Thus you can use the wrong separator (between date elements, between hour and minute for time-stamps, between integer and decimal parts in any real number) in the MX editor and the incorrect line will be accepted. 
 
==Correcting date separator errors==
 
The legacy software accepts any character (except space) as the separator between the day of month, the month, and the year, elements of the date.  Therefore Cumulus 1 does not care if that separator is sometimes "/", sometimes "-", and/or sometimes ".".
 
MX is fussy, the same separator must be used in every date in the file. An error will be reported in diagnostics, and the historic graphs will stop working if the separator changes from one line to another.
# So look at the last line in the file, that is the character MX expects
# If any earlier line, or lines, uses a different character, then that line, or lines, must be edited, it is best to use an editor designed for programmers
#*If the last line has hyphen "-", but some earlier lines use slash "/", it is simple to do an edit
#** Use "Replace All" option in your chosen editor, to find "/", and replace with "-".  This works because "/" does not appear anywhere else in the file
#*If the last line has "/", but some earlier lines have "." or "-" as separator, then the correction is more complex, because you don't want to edit any minus signs or decimal points in any other fields
#** See if your editor accepts "Regular Expressions", then you can look for two matching separators in same field, see [https://cumulus.hosiene.co.uk/viewtopic.php?p=152540#p152540 this forum post].
 
See [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=18340 this forum thread] for a fuller discussion.


= Importing data not recorded by Cumulus =
= Importing data not recorded by Cumulus =
5,838

edits

Navigation menu