/[Biblio-Isis]/trunk/scripts/dump_isisdb.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/scripts/dump_isisdb.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/scripts/dump_isis.pl revision 15 by dpavlin, Wed Dec 29 22:46:40 2004 UTC trunk/scripts/dump_isisdb.pl revision 71 by dpavlin, Fri May 18 21:16:43 2007 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use IsisDB;  use Biblio::Isis 0.24;
7  use Data::Dumper;  use Getopt::Std;
8    
9  my $isisdb = shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI',  BEGIN {
10  my $debug = shift @ARGV;          eval "use Data::Dump";
11    
12  my $isis = IsisDB->new (          if (! $@) {
13                    *Dumper = *Data::Dump::dump;
14            } else {
15                    use Data::Dumper;
16            }
17    }
18    
19    my %opt;
20    getopts('do:l:v', \%opt);
21    
22    my $isisdb = shift @ARGV || die "usage: $0 [-v] [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n";
23    
24    my $isis = Biblio::Isis->new (
25          isisdb => $isisdb,          isisdb => $isisdb,
26          debug => $debug,          debug => $opt{'d'} ? 2 : 0,
27          include_deleted => 1,          include_deleted => $opt{'v'},
28  #       read_fdt => 1,  #       read_fdt => 1,
29            ignore_empty_subfields => $opt{'v'} ? 0 : 1,
30  );  );
31    
32  print "rows: ",$isis->{'maxmfn'},"\n\n";  print "rows: ",$isis->count,"\n\n";
33    
34    my $min = $opt{o} || 1;
35    my $max = $isis->count;
36    $max = ( $min + $opt{l} - 1 ) if ($opt{l});
37    
38  for(my $mfn = 1; $mfn <= $isis->{'maxmfn'}; $mfn++) {  for my $mfn ($min .. $max) {
39          print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($debug);          print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});
40          print $isis->to_ascii($mfn),"\n";          print $isis->to_ascii($mfn),"\n";
41    
42  }  }

Legend:
Removed from v.15  
changed lines
  Added in v.71

  ViewVC Help
Powered by ViewVC 1.1.26