4 use Getopt::Long qw( GetOptions );
5 use Pod::Usage qw( pod2usage );
8 use C4::Biblio qw( DelBiblio );
15 pod2usage(1) if $help or not @ARGV;
17 for my $file ( @ARGV ) {
18 say "Find biblionumber in file $file";
20 open($fh, '<', $file) or say "Error: '$file' $!" and next;
23 my $biblionumber = $_;
24 $biblionumber =~ s/$1/\n/g if $biblionumber =~ m/(\r\n?|\n\r?)/;
26 my $dbh = C4::Context->dbh;
27 next if not $biblionumber =~ /^\d*$/;
28 print "Delete biblionumber $biblionumber ";
31 $error = DelBiblio $biblionumber;
34 say "KO $@ ($! | $error)";
51 ./batchdeletebiblio.pl file1 [file2 ... filen]
53 This script batch deletes biblios which contain a biblionumber present in file passed in parameter.
54 If one biblio has items, it is not deleted.
62 prints this help message
68 Jonathan Druart <jonathan.druart@biblibre.com>
72 Copyright 2012 BibLibre
76 This file is part of Koha.
78 Koha is free software; you can redistribute it and/or modify it
79 under the terms of the GNU General Public License as published by
80 the Free Software Foundation; either version 3 of the License, or
81 (at your option) any later version.
83 Koha is distributed in the hope that it will be useful, but
84 WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86 GNU General Public License for more details.
88 You should have received a copy of the GNU General Public License
89 along with Koha; if not, see <http://www.gnu.org/licenses>.
91 =head1 DISCLAIMER OF WARRANTY
93 Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
94 A PARTICULAR PURPOSE. See the GNU General Public License for more details.