From e1f33930152d8aefcbe0e1a62a68b4791710147b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 8 Feb 2004 03:34:08 +0000 Subject: [PATCH] Updated. --- tools/channeldbConvert.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/channeldbConvert.py b/tools/channeldbConvert.py index 92fde13ae..4e0ff5150 100755 --- a/tools/channeldbConvert.py +++ b/tools/channeldbConvert.py @@ -32,6 +32,7 @@ __revision__ = "$Id$" import os +import csv import sys if len(sys.argv) <= 1: @@ -78,9 +79,11 @@ if __name__ == '__main__': cursor = db.cursor() cursor.execute("""SELECT word_stats.user_id, words.word, word_stats.count - FROM word_stats, words""") + FROM word_stats, words + WHERE word_stats.word_id = words.id""") d = {} for (id, word, count) in cursor.fetchall(): + #print word, count d.setdefault(id, {})[word] = count for (id, d) in d.items(): L = [channel, id]