/[Biblio-Isis]/trunk/scripts/dump_openisis.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

Contents of /trunk/scripts/dump_openisis.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (show annotations)
Wed Dec 29 20:10:59 2004 UTC (17 years, 9 months ago) by dpavlin
File MIME type: text/plain
File size: 805 byte(s)
added debug output which displays raw structures

1 #!/usr/bin/perl -w
2
3 # this utility emulates output of openisis -db "database"
4 # so you can test if perl can read your isis file
5
6 #use strict;
7 use OpenIsis;
8 use Data::Dumper;
9
10 my $db = OpenIsis::open( shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI' );
11 my $debug = shift @ARGV;
12 my $maxmfn = OpenIsis::maxRowid( $db ) || 1;
13
14 print "rows: $maxmfn\n\n";
15
16 for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) {
17 print "0\t$mfn\n";
18 my $row = OpenIsis::read( $db, $mfn );
19 if ($debug) {
20 print STDERR Dumper($row),"\n";
21 my $rec;
22 foreach my $f (keys %{$row}) {
23 foreach my $v (@{$row->{$f}}) {
24 push @{$rec->{$f}}, OpenIsis::subfields($v);
25 }
26 }
27 print STDERR Dumper($rec);
28 }
29 foreach my $k (sort keys %{$row}) {
30 next if ($k eq 'mfn');
31 print "$k\t",join("\n$k\t",@{$row->{$k}}),"\n";
32 }
33 print "\n";
34 }
35

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26