/[tokyocabinet-toys]/marc-tsv.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 /marc-tsv.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Fri Oct 22 16:17:57 2010 UTC (13 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 569 byte(s)
dump MARC

1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use MARC::Fast;
7 use Data::Dump qw/dump/;
8
9 my ( $file, $debug ) = @ARGV;
10
11 my @skip = qw(
12 00019784
13 00026677
14 );
15
16 my $marc = new MARC::Fast(
17 marcdb => $file,
18 debug => $debug,
19 );
20
21 my $skip_pos = 0;
22
23 for my $mfn ( 1 .. $marc->count ) {
24 my $rec = $marc->fetch($mfn) || next;
25
26 my $tsv = "rec\t$mfn\tleader\t", $marc->last_leader, "\t";
27 my $ascii = $marc->to_ascii($mfn);
28 $ascii =~ s{\n}{\t}gs;
29 $ascii =~ s{[\x00- ]}{ }gs;
30 $tsv .= $ascii;
31 print "$tsv\n";
32 warn dump($marc->to_hash($mfn, include_subfields => 1)) if $debug;
33 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26