3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use IsisDB; |
use Biblio::Isis; |
7 |
use Data::Dumper; |
use Getopt::Std; |
8 |
|
|
9 |
my $isis = IsisDB->new ( |
BEGIN { |
10 |
isisdb => shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI', |
eval "use Data::Dump"; |
11 |
debug => shift @ARGV, |
|
12 |
|
if (! $@) { |
13 |
|
*Dumper = *Data::Dump::dump; |
14 |
|
} else { |
15 |
|
use Data::Dumper; |
16 |
|
} |
17 |
|
} |
18 |
|
|
19 |
|
my %opt; |
20 |
|
getopts('dn:', \%opt); |
21 |
|
|
22 |
|
my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-d] /path/to/isis/BIBL\n"; |
23 |
|
|
24 |
|
my $isis = Biblio::Isis->new ( |
25 |
|
isisdb => $isisdb, |
26 |
|
debug => $opt{'d'} ? 2 : 0, |
27 |
include_deleted => 1, |
include_deleted => 1, |
28 |
|
# read_fdt => 1, |
29 |
); |
); |
30 |
|
|
31 |
print "rows: ",$isis->{'maxmfn'},"\n\n"; |
print "rows: ",$isis->count,"\n\n"; |
32 |
|
|
33 |
|
my $min = 1; |
34 |
|
my $max = $isis->count; |
35 |
|
$max = $opt{n} if ($opt{n}); |
36 |
|
|
37 |
for(my $mfn = 1; $mfn <= $isis->{'maxmfn'}; $mfn++) { |
for my $mfn ($min .. $max) { |
38 |
|
print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'}); |
39 |
print $isis->to_ascii($mfn),"\n"; |
print $isis->to_ascii($mfn),"\n"; |
40 |
|
|
41 |
} |
} |