]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/src/extras/import/pre_cat_items.pl
last minute fixes -- frozen now for all time, as the data is in the DB
[Evergreen.git] / Evergreen / src / extras / import / pre_cat_items.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 print <<SQL;
7 DROP TABLE legacy_pre_cat;
8 CREATE TABLE legacy_pre_cat (barcode text, lib text, title text, author text);
9 COPY legacy_pre_cat (barcode, lib, title, author) FROM STDIN;
10 SQL
11
12 while (<>) {
13         chomp;
14         my ($bc,$l,$t,$a) = split '\|';
15         $bc =~ s/\s*$//o;
16         print "$bc\t$l\t$t\t$a\n";
17 }
18
19 print '\.'."\n";
20 print "CREATE INDEX precat_bc_idx ON legacy_pre_cat (barcode);\n";
21