Delete wrong data from database

2,156 views
Skip to first unread message

pterodaktil

unread,
May 21, 2013, 12:00:40 AM5/21/13
to weewx...@googlegroups.com
I have wrong data  in database (142.5°C at 18-May-2013 13:13)
Can you help me to delete it

Message has been deleted

Thomas Keffer

unread,
May 21, 2013, 9:50:18 AM5/21/13
to weewx-user
First, you will have to calculate the unix epoch time of the bad data. You can use this website to do so.

Once you have the correct time,

$> sqlite3 /home/weewx/archive/weewx.sdb
sqlite> update archive set outTemp=null where dateTime=XXXXXXX;

where XXXXXXX is the unix epoch time.

You might want to set the types dependent on outTemp to null as well: dewpoint, windchill, heatindex.

-tk



On Mon, May 20, 2013 at 9:00 PM, pterodaktil <pterod...@mail.ru> wrote:
I have wrong data  in database (142.5°C at 18-May-2013 13:13)
Can you help me to delete it

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

Thomas Keffer

unread,
May 21, 2013, 10:11:21 AM5/21/13
to weewx-user
This reminds me, if you are running on a reasonably powerful machine (not a Raspberry Pi), you can use the SQLite Database Browser:

$ sudo apt-get install sqlitebrowser

This will provide a graphical interface, making it easy to edit the file.

-tk


On Tue, May 21, 2013 at 12:54 AM, Andrew Milner <andrew.s...@gmail.com> wrote:
1. You can use mysqladmin or sqliteadmin to directly examine, query and edit the archive and stats databases and database tables
 
2. You can either edit the values in the stats database directly if the archive is right but the stats table(s) is/are wrong or change both if you know what the value(s) should be.  I am assuming that the wrong data is an erroneous 'high' value here.
 
3. You can stop weewx, delete the stats database but keep the archive database, restart weewx and the stats database will be re-created using only the archived data - this will lose any highs or lows that may have occurred between archive records and been added to the stats database though
 
Guess we really need to know a little more about exactly what you are trying to correct, and why.
 

On Tuesday, 21 May 2013 07:00:40 UTC+3, pterodaktil wrote:
I have wrong data  in database (142.5°C at 18-May-2013 13:13)
Can you help me to delete it

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andrew Milner

unread,
May 21, 2013, 10:41:37 AM5/21/13
to weewx...@googlegroups.com
I installed phpliteadmin on the pi and browse to that to edit the databases if needed

pterodaktil

unread,
May 22, 2013, 12:01:06 AM5/22/13
to weewx...@googlegroups.com
thanks for all

вторник, 21 мая 2013 г., 8:00:40 UTC+4 пользователь pterodaktil написал:
Reply all
Reply to author
Forward
0 new messages