2 # small script that dumps an iso2709 file.
8 use MARC::File::USMARC;
13 my ( $input_marc_file,$number,$nowarning) = ('',0);
16 'file:s' => \$input_marc_file,
22 warn "NUM : $number\n";
23 if ($version || ($input_marc_file eq '')) {
25 small script to dump an iso2709 file.
27 \tv : this version/help screen
28 \tfile /path/to/file/to/dump : the file to dump
29 \tn : the number of the record to dump. If missing, all the file is dumped
30 \tw : warning and strict off. If your dump fail, try -w option. It it works, then, the file is iso2709, but a buggy one !
31 SAMPLE : ./dumpmarc.pl -file /home/paul/koha.dev/local/npl -n 1
37 my $batch = MARC::Batch->new( 'USMARC', $input_marc_file );
38 $batch->warnings_off() unless $nowarning;
39 $batch->strict_off() unless $nowarning;
41 while ( my $record = $batch->next() ) {
42 print "\nNUMBER $i =>\n".$record->as_formatted() if ($i eq $number || $number eq 0);
45 print "\n==================\n$i record parsed\n";