first working version:
[Biblio-Isis] / scripts / dump_openisis.pl
diff --git a/scripts/dump_openisis.pl b/scripts/dump_openisis.pl
new file mode 100755 (executable)
index 0000000..32adb0f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+# this utility emulates output of openisis -db "database"
+# so you can test if perl can read your isis file
+
+#use strict;
+use OpenIsis;
+
+my $db = OpenIsis::open( shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI' );
+my $maxmfn = OpenIsis::maxRowid( $db ) || 1;
+
+print "rows: $maxmfn\n\n";
+
+for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) {
+       print "0\t$mfn\n";
+       my $row = OpenIsis::read( $db, $mfn );
+       foreach my $k (sort keys %{$row}) {
+               next if ($k eq 'mfn');
+               print "$k\t",join("\n$k\t",@{$row->{$k}}),"\n";
+       }
+       print "\n";
+}
+