You may find this thread useful
https://stackoverflow.com/questions/5776660/export-from-sqlite-to-csv-using-shell-script

change the select statement to select the fileds you want and add a where 
dateTime > clause.

you will still have two issues though to resolve
a) you really only want the data since you last grabbed it and also convert 
real time to an epoch time to insert iinto the where clause
b) running every hour for the l;ast couple of days' data is a bit ott I 
would have thought.  Maybe you just need to run at midnight for the 
previous day's data?

c) if the file is only needed for extremes of weather then change your 
select clause to limit the wind/temp/rain fields.



On Wednesday, 9 May 2018 11:05:09 UTC+3, Glenn McKechnie wrote:
>
> Hi Chris, 
>
> If you're happy to take all the data, and sort the chaff later, then 
> the following may help. 
>
> https://github.com/weewx/weewx/wiki/csv 
>
> That will output all the data as a csv formatted file. 
>
> binding: 
> It's default is every loop packet which I suspect will be more often 
> than you want the data. archive would be the one that matches your 
> archive_interval in weewx.conf 
>
>
>
>
> Cheers 
>  Glenn 
>
> rorpi - read only raspberry pi & various weewx addons 
> https://github.com/glennmckechnie 
>
>
> On 9 May 2018 at 17:09, Chris Schram <[email protected] <javascript:>> 
> wrote: 
> > Background: I am a weather spotter on the Oregon coast. When there is 
> > excessive rain or wind, I am supposed to report it to the regional NWS 
> > office. 
> > 
> > I recently attached my Vantage Vue to a spare Raspberry Pi 2B (after my 
> old 
> > iMac died), and after some initial headaches, got weewx working the way 
> I 
> > want it to. Except for one thing… 
> > 
> > I need a script that I can run as an hourly cron job, that can grab the 
> last 
> > few days of wind and rain data from weewx.sdb, and export it to CSV (or 
> some 
> > other format a spreadsheet can process). 
> > 
> > I have stared at much of the  sqlite3 documentation until my eyes glazed 
> > over, but what should seem to be a simple solution is way beyond what my 
> > simple mind can comprehend. 
> > 
> > Can someone here help get me started? I have no experience whatsoever 
> with 
> > SQLite. 
> > 
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to