/[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

Annotation of /trunk/scripts/dump_isisdb.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 71 - (hide annotations)
Fri May 18 21:16:43 2007 UTC (15 years, 8 months ago) by dpavlin
File MIME type: text/plain
File size: 773 byte(s)
added -v to dump script which will display erased records and empty subfields
1 dpavlin 2 #!/usr/bin/perl -w
2    
3     use strict;
4 dpavlin 50 use blib;
5 dpavlin 2
6 dpavlin 71 use Biblio::Isis 0.24;
7 dpavlin 42 use Getopt::Std;
8 dpavlin 2
9 dpavlin 50 BEGIN {
10     eval "use Data::Dump";
11    
12     if (! $@) {
13     *Dumper = *Data::Dump::dump;
14     } else {
15     use Data::Dumper;
16     }
17     }
18    
19 dpavlin 42 my %opt;
20 dpavlin 71 getopts('do:l:v', \%opt);
21 dpavlin 13
22 dpavlin 71 my $isisdb = shift @ARGV || die "usage: $0 [-v] [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n";
23 dpavlin 42
24 dpavlin 36 my $isis = Biblio::Isis->new (
25 dpavlin 13 isisdb => $isisdb,
26 dpavlin 50 debug => $opt{'d'} ? 2 : 0,
27 dpavlin 71 include_deleted => $opt{'v'},
28 dpavlin 15 # read_fdt => 1,
29 dpavlin 71 ignore_empty_subfields => $opt{'v'} ? 0 : 1,
30 dpavlin 2 );
31    
32 dpavlin 32 print "rows: ",$isis->count,"\n\n";
33 dpavlin 4
34 dpavlin 68 my $min = $opt{o} || 1;
35 dpavlin 42 my $max = $isis->count;
36 dpavlin 68 $max = ( $min + $opt{l} - 1 ) if ($opt{l});
37 dpavlin 42
38     for my $mfn ($min .. $max) {
39     print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});
40 dpavlin 2 print $isis->to_ascii($mfn),"\n";
41    
42     }
43    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26