5 |
use URI::Escape; |
use URI::Escape; |
6 |
require "../common.pm"; |
require "../common.pm"; |
7 |
|
|
8 |
|
$|++; |
9 |
|
my $debug=0; |
10 |
|
|
11 |
my $file = shift @ARGV; |
my $file = shift @ARGV; |
12 |
my $index = shift @ARGV|| die "Usage: $0 [marc file] [index dir]"; |
my $index = shift @ARGV || die "Usage: $0 [marc file] [index dir]"; |
13 |
|
|
14 |
my %id_stored; # to aviod duplicates |
my %id_stored; # to aviod duplicates |
15 |
|
|
17 |
my $nr = $x->openmarc( { file => $file, format => 'usmarc' }) || |
my $nr = $x->openmarc( { file => $file, format => 'usmarc' }) || |
18 |
die "Can't open MARC file '$file'"; |
die "Can't open MARC file '$file'"; |
19 |
|
|
20 |
print "file: '$file' 773 t: ",$x->getfirstvalue({record=>$x->nextmarc(1),field=>773,subfield=>'t',delimiter=>" "}),"\n"; |
my $dir = open_data_files($index,$debug); |
|
$x->nextmarc(-1); |
|
|
|
|
|
my $dir = open_data_files($index); |
|
21 |
my $last_tell=0; |
my $last_tell=0; |
22 |
|
|
23 |
print MPS "M working...\n"; |
print MPS "M working...\n"; |
29 |
|
|
30 |
$rec = $x->marc_count(); |
$rec = $x->marc_count(); |
31 |
# print $x->getfirstvalue({record=>$rec,field=>245,subfield=>'a',delimiter=>" "}),"<--\n"; |
# print $x->getfirstvalue({record=>$rec,field=>245,subfield=>'a',delimiter=>" "}),"<--\n"; |
32 |
|
print "file: '$file' 773 t: ",$x->getfirstvalue({record=>$rec,field=>773,subfield=>'t',delimiter=>" "})," [index: $index]\n" if ($last_tell == 0); |
33 |
|
|
34 |
my $bib = ""; |
my $bib = ""; |
35 |
my $mps = ""; |
my $mps = ""; |
36 |
|
|
82 |
print MPS $mps; |
print MPS $mps; |
83 |
|
|
84 |
$id_stored{$id}++; |
$id_stored{$id}++; |
85 |
|
print "_" if ($debug); |
86 |
} else { |
} else { |
87 |
print "."; |
print "." if ($debug); |
88 |
} |
} |
89 |
} |
} |
90 |
|
|