If you need to export to CSV only once, then there is no need to convert
the database. Just make a copy, convert that, export to CSV, then throw the
copy away.

Otherwise, if you expect to do this regularly, then, yes, convert and use
the converted database.

There should be no problems with upgrades. Being able to support multiple
database systems is a key feature of WeeWX.

-tk

On Wed, Apr 22, 2020 at 7:39 AM Janne Prokkola <[email protected]>
wrote:

> hello
> sorry, I add more info.
>
> I have sqlite. In User's Guide it says:
>
> "Because of this, unless you have a special purpose application, there is
> really no good reason to change from the default, which is US"
>
> I want to keep the installation as default as possible. But on the other
> hand if I want to export sqlite as metrics, should we think this is a
> special purpose enough to start with (or convert to) metrics?
>
> And, if I choose to use metrics in database, will there be any problems in
> future upgrades like should I always make changes in conf-files after
> upgrade?
>
> Janne
>
>
> tiistai 21. huhtikuuta 2020 23.53.12 UTC+3 Tom Keffer kirjoitti:
>>
>> If you want the results in metric, it would be best to convert the
>> database first, then dump it to CSV. For how to convert the database, see
>> the section *Changing the database unit system
>> <http://www.weewx.com/docs/customizing.htm#Changing_the_unit_system>* in
>> the Customizing Guide.
>>
>> You didn't say what kind of database, but if you use sqlite, the utility
>> sqlite3 can export to CSV. You may need to download it first
>>
>> *sudo apt install sqlite3*
>>
>> Then
>>
>> *sqlite3 weewx.sdb*
>> sqlite> *.headers on*
>> sqlite> *.mode csv*
>> sqlite> *.output weewx.csv*
>> sqlite> *select * from archive;*
>>
>> This will create a file weewx.csv with the data. It will be in whatever
>> unit system your database is in. Hence, the need to convert first.
>>
>> Documentation for sqlite3 <https://sqlite.org/cli.html>.
>>
>>
>>
>> On Tue, Apr 21, 2020 at 12:24 PM Janne Prokkola <[email protected]>
>> wrote:
>>
>>> hello
>>>
>>> I'd like to export my database to csv. Is there any easy way to export
>>> US format database to metrics units?
>>>
>>> I'm building my weather station set up. I'm thinking should I have the
>>> database in metrics format or should I stay in US. In Finland I have no use
>>> for imperial/US units.
>>>
>>> best regards
>>> Janne Prokkola
>>>
>>> --
>>> 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].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/ba6c819d-a9c5-406e-9854-60af09e81b9b%40googlegroups.com
>>> <https://groups.google.com/d/msgid/weewx-user/ba6c819d-a9c5-406e-9854-60af09e81b9b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/79f911de-a153-4968-9dd7-0e35b4c19ba6%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/79f911de-a153-4968-9dd7-0e35b4c19ba6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEC%2B9_ou%3DpD%3DnCOWR5pJJf9gBqUTGTV6CnahoErt0gt7mQ%40mail.gmail.com.

Reply via email to