So you want to build a file with potentially 8928 rows (31 days per month 288 records per day)?
If so this should be able to be done solely in a Cheetah template using just a few lines of code by iterating over the archive records in the month. Something like (untested): #for $record in $month.records $record.dateTime,$record.outTemp.format(add_label=False),..... #end for Like I said untested and I haven't used record iterators for a long time but at worst a little finessing should get you there. One thing to note, report generation time will gradually increase as the month progresses peaking on the last record of the last day of the month. Gary On Thursday, 19 December 2024 at 05:55:37 UTC+10 rory.g...@googlemail.com wrote: > Hi, at first I thought this would be quite easy but I'm struggling a bit. > The background is I need a text file to import into WXSim using the Cumulus > %Y%mlog.txt format. I created a simple skin that generates the %Y%mlog.txt > each reporting cycle (5 minutes in my case), but is there a way to append > the next cycle to the existing file as a new line rather than overwrite it? > > My skin.conf looks like this: > > [CheetahGenerator] > encoding = utf8 > > [[ToDate]] > [[[text-data]]] > template = %Y%mlog.txt.tmpl > > [CopyGenerator] > copy_always = *.txt > > [Generators] > generator_list = weewx.cheetahgenerator.CheetahGenerator, > weewx.reportengine.CopyGenerator > > And the template: > > #encoding UTF-8 > #errorCatcher Echo > ## +------------------------------------------------------+ > ## | Cumulus Monthly Output Template | > ## +------------------------------------------------------+ > ## | Produces a YYYYmmlog.txt output for import to WXSim | > ## +------------------------------------------------------+ > > > > $current.dateTime,$current.outTemp.format(add_label=False),$current.outHumidity.format(add_label=False),$current.dewpoint.format(add_label=False),$current.windSpeed.format(add_label=False),$current.windGust.format(add_label=False),$current.windDir.format(add_label=False),,,$current.barometer.format(add_label=False),$day.rain.sum.format(add_label=False),,,,,,,$current.radiation.format(add_label=False), > > Which produces a text file called 202412log.txt: > > 18/12/24 19:40:00,6.3,82,3.4,10,37,266,,,982.8,15.4,,,,,,,0, > > WXSim can read this, however it only contains a single observation period. > I would like to append the data to the file until the month is complete, > then generate a new file for the next month. Any ideas? It will likely need > some Python which is not my strongpoint, although I can get around it a > bit... > > I'm running WeeWX 5.1 if it makes it easier. TIA > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/weewx-user/d2e91a2a-7399-4377-9881-e3cfaccd2516n%40googlegroups.com.