]> pd.if.org Git - newsd/blob - convnewsgroups
Let database figure out close time for connection.
[newsd] / convnewsgroups
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use DBI;
7
8 $\="\n";
9
10 my $db = DBI->connect(undef,undef,undef,{RaiseError=>1,AutoCommit=>0});
11
12 #$db->do("set client_encoding to 'LATIN1'");
13 my $i = $db->prepare('update newsgroups set description = ? where newsgroup = ?');
14
15 while (<>) {
16         chomp;
17         my ($group, $desc) = split(/\s+/, $_, 2);
18         $i->execute($desc,$group);
19 }
20 $db->commit;
21
22 __END__
23 aaa.inu-chan 0000000000 0000000001 m
24 ab.arnet 0000000000 0000000001 m
25 ab.general 0000000000 0000000001 y
26 ab.jobs 0000000000 0000000001 y
27 ab.politics 0000000000 0000000001 y
28 abg.allgemein 0000000000 0000000001 y
29 abg.amiga 0000000000 0000000001 y
30 abg.comp 0000000000 0000000001 y
31 abg.diskussion 0000000000 0000000001 y
32 abg.english 0000000000 0000000001 y