added debug output which displays raw structures
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Dec 2004 20:10:59 +0000 (20:10 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Dec 2004 20:10:59 +0000 (20:10 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@13 4670fa4d-42ec-0310-ab5b-a66af6943492

scripts/dump_isis.pl
scripts/dump_openisis.pl

index 9537987..ea59d0f 100755 (executable)
@@ -6,15 +6,19 @@ use blib;
 use IsisDB;
 use Data::Dumper;
 
+my $isisdb = shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI',
+my $debug = shift @ARGV;
+
 my $isis = IsisDB->new (
-       isisdb => shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI',
-       debug => shift @ARGV,
+       isisdb => $isisdb,
+       debug => $debug,
        include_deleted => 1,
 );
 
 print "rows: ",$isis->{'maxmfn'},"\n\n";
 
 for(my $mfn = 1; $mfn <= $isis->{'maxmfn'}; $mfn++) {
+       print STDERR Dumper($isis->to_hash($mfn)) if ($debug);
        print $isis->to_ascii($mfn),"\n";
 
 }
index 32adb0f..25e1d54 100755 (executable)
@@ -5,8 +5,10 @@
 
 #use strict;
 use OpenIsis;
+use Data::Dumper;
 
 my $db = OpenIsis::open( shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI' );
+my $debug = shift @ARGV;
 my $maxmfn = OpenIsis::maxRowid( $db ) || 1;
 
 print "rows: $maxmfn\n\n";
@@ -14,6 +16,16 @@ print "rows: $maxmfn\n\n";
 for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) {
        print "0\t$mfn\n";
        my $row = OpenIsis::read( $db, $mfn );
+       if ($debug)  {
+               print STDERR Dumper($row),"\n";
+               my $rec;
+               foreach my $f (keys %{$row}) {
+                       foreach my $v (@{$row->{$f}}) {
+                               push @{$rec->{$f}}, OpenIsis::subfields($v);
+                       }
+               }
+               print STDERR Dumper($rec);
+       }
        foreach my $k (sort keys %{$row}) {
                next if ($k eq 'mfn');
                print "$k\t",join("\n$k\t",@{$row->{$k}}),"\n";