From 5916908e35288e4a9bf02bc8aeeadd366713924b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 6 Feb 2010 12:31:11 +0100 Subject: [PATCH] Bug 4125 - Reformat with perldoc bulkmarcimport.pl doc Signed-off-by: Galen Charlton --- misc/migration_tools/bulkmarcimport.pl | 179 +++++++++++++++++++++++---------- 1 file changed, 127 insertions(+), 52 deletions(-) diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 6a8a16b6df..da0ebf7f2e 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -28,6 +28,7 @@ use Unicode::Normalize; use Time::HiRes qw(gettimeofday); use Getopt::Long; use IO::File; +use Pod::Usage; binmode(STDOUT, ":utf8"); my ( $input_marc_file, $number, $offset) = ('',0,0); @@ -62,58 +63,8 @@ GetOptions( $biblios=!$authorities||$biblios; if ($version || ($input_marc_file eq '')) { - print < 2 ); + exit; } if (defined $idmapfl) { @@ -464,3 +415,127 @@ sub printlog{ my $logelements=shift; print $loghandle join (";",@$logelements{qw}),"\n"; } + + +=head1 NAME + +bulkmarcimport.pl - Import bibliographic/authority records into Koha + +=head1 USAGE + + $ export KOHA_CONF=/etc/koha.conf + $ perl misc/migration_tools/bulkmarcimport.pl -d -commit 1000 \\ + -file /home/jmf/koha.mrc -n 3000 + +=head1 WARNING + +Don't use this script before you've entered and checked your MARC parameters +tables twice (or more!). Otherwise, the import won't work correctly and you +will get invalid data. + +=head1 DESCRIPTION + +=over + +=item B<-h> + +This version/help screen + +=item B<-b, -biblios> + +Type of import: bibliographic records + +=item B<-a, -authorities> + +Type of import: authority records + +=item B<-file>=I + +The I to import + +=item B<-v> + +Verbose mode. 1 means "some infos", 2 means "MARC dumping" + +=item B<-fk> + +Turn off foreign key checks during import. + +=item B<-n>=I + +The I of records to import. If missing, all the file is imported + +=item B<-o, -offset>=I + +File offset before importing, ie I of records to skip. + +=item B<-commit>=I + +The I of records to wait before performing a 'commit' operation + +=item B<-l> + +File logs actions done for each record and their status into file + +=item B<-t> + +Test mode: parses the file, saying what he would do, but doing nothing. + +=item B<-s> + +Skip automatic conversion of MARC-8 to UTF-8. This option is provided for +debugging. + +=item B<-c>=I + +The I MARC flavour. At the moment, only I and +I are supported. MARC21 by default. + +=item B<-d> + +Delete EVERYTHING related to biblio in koha-DB before import. Tables: biblio, +biblioitems, items + +=item B<-m>=I + +Input file I: I or I (defaults to ISO2709) + +=item B<-k, -keepids>= + +Field store ids in I (usefull for authorities, where 001 contains the +authid for Koha, that can contain a very valuable info for authorities coming +from LOC or BNF. useless for biblios probably) + +=item B<-match>= + +I matchindex,fieldtomatch matchpoint to use to deduplicate fieldtomatch +can be either 001 to 999 or field and list of subfields as such 100abcde + +=item B<-i,-isbn> + +If set, a search will be done on isbn, and, if the same isbn is found, the +biblio is not added. It's another method to deduplicate. B<-match> & B<-isbn> +can be both set. + +=item B<-x>=I + +Source bib I for reporting the source bib number + +=item B<-y>=I + +Source I for reporting the source bib number + +=item B<-idmap>=I + +I for the koha bib and source id + +=item B<-keepids> + +Store ids in 009 (usefull for authorities, where 001 contains the authid for +Koha, that can contain a very valuable info for authorities coming from LOC or +BNF. useless for biblios probably) + +=back + +=cut + -- 2.11.0