X-Git-Url: http://git.rot13.org/?p=MARC-Fast;a=blobdiff_plain;f=scripts%2Fdump_fastmarc.pl;h=538f8ead6ab3874c73571bb686e4381b75409b51;hp=a37171c8b9d71bbbf5f4cd6fdb60b33f471c3473;hb=8300e4b53e83d8a355dba26d74624d521f67232f;hpb=96b41f990776b11c9bb1824d34cb93c368985053 diff --git a/scripts/dump_fastmarc.pl b/scripts/dump_fastmarc.pl index a37171c..538f8ea 100755 --- a/scripts/dump_fastmarc.pl +++ b/scripts/dump_fastmarc.pl @@ -17,22 +17,24 @@ my $marc = new MARC::Fast( debug => $opt{'d'}, ); -print STDERR "$file has ",$marc->count," records...\n"; my $min = 1; my $max = $marc->count; if (my $mfn = $opt{'n'}) { $min = $max = $mfn; + print STDERR "Dumping $mfn only\n"; +} else { + print STDERR "$file has $max records...\n"; } -print STDERR "Dumping $min - $max\n" if ($opt{'d'}); - for my $mfn ($min .. $max) { my $rec = $marc->fetch($mfn) || next; + print Dumper($rec); print "REC $mfn\n"; foreach my $f (sort keys %{$rec}) { - print "$f\t",$rec->{$f},"\n"; + print "$f\t", join('', $rec->{$f}) ,"\n"; } print "\n"; + print Dumper($marc->to_hash($mfn)); }