/[MARC-Fast]/trunk/scripts/dump_fastmarc.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

Diff of /trunk/scripts/dump_fastmarc.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 37 by dpavlin, Thu Sep 23 12:26:42 2010 UTC revision 46 by dpavlin, Thu Aug 22 10:48:18 2013 UTC
# Line 35  dump result of C<to_hash> on record Line 35  dump result of C<to_hash> on record
35    
36  turn debugging output on  turn debugging output on
37    
38    =item -t
39    
40    dump tsv file for TokyoCabinet import
41    
42  =back  =back
43    
44  =cut  =cut
45    
46  my %opt;  my %opt;
47  getopts('do:l:h', \%opt);  getopts('do:l:ht', \%opt);
48    
49  my $file = shift @ARGV || die "usage: $0 [-o offset] [-l limit] [-h] [-d] file.marc\n";  my $file = shift @ARGV || die "usage: $0 [-o offset] [-l limit] [-h] [-d] file.marc\n";
50    
# Line 65  if (my $mfn = $opt{n}) { Line 69  if (my $mfn = $opt{n}) {
69    
70  for my $mfn ($min .. $max) {  for my $mfn ($min .. $max) {
71          my $rec = $marc->fetch($mfn) || next;          my $rec = $marc->fetch($mfn) || next;
72          print "rec is ",dump($rec) if ($opt{d});          warn "rec is ",dump($rec) if ($opt{d});
73          print "REC $mfn\n";          if ( $opt{t} ) {
74          print $marc->last_leader,"\n";                  print "rec\t$mfn\tleader\t", $marc->last_leader, "\t";
75          print $marc->to_ascii($mfn),"\n";                  my $ascii = $marc->to_ascii($mfn);
76          print "hash is ",dump($marc->to_hash($mfn, include_subfields => 1)) if ($opt{h});                  $ascii =~ s{\n}{\t}gs;
77                    print "$ascii\n";
78            } else {
79                    print "REC $mfn\n";
80                    print $marc->last_leader,"\n";
81                    print $marc->to_ascii($mfn),"\n";
82            }
83            warn "hash is ",dump($marc->to_hash($mfn, include_subfields => 1)) if ($opt{h});
84  }  }

Legend:
Removed from v.37  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.26