X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=extract_loadset;h=61326bdd0c575e3dfd069b18139926353c63aa8b;hp=d326fcdf5ac7113f9ed9dcb405d1d2d290951f23;hb=220c52587cae597d5ac513f122342b1e703a099b;hpb=34990394b1c7c4d41272e5830b90e7bad1239ac5 diff --git a/extract_loadset b/extract_loadset index d326fcd..61326bd 100755 --- a/extract_loadset +++ b/extract_loadset @@ -1,4 +1,21 @@ #!/usr/bin/perl + +# Copyright 2009-2012, Equinox Software, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + use strict; use warnings; use open ':utf8'; @@ -24,7 +41,12 @@ open MI, '<', $conf->{input} or die "Can't open input file: $!\n"; open MO, '>', $conf->{output} or die "Can't open output file: $!\n"; while () { m/tag="$conf->{tag}".+?(\d+){reverse}) { + print MO if $exclude{$1}; + } else { + print MO unless $exclude{$1}; + } } @@ -41,6 +63,7 @@ sub initialize { 'output|o=s', 'tag|t=i', 'subfield|s=s', + 'reverse|r', 'help|h', ); show_help() unless $rc; @@ -68,6 +91,7 @@ Usage is: extract_loadset -l BOUND -i INPUTXML -o OUTPUTXML MATCHSET --output -o MARCXML output file --tag -t MARC tag to use as identifier (default: 903) --subfield -s Subfield of --tag argument (default: 'a') + --reverse -r Output subordinate bibs rather than lead bibs HELP exit; }