'exclude-item-id-file=s',
'exclude-item-barcode-file=s',
'exclude-item-circmod-file=s',
+ 'exclude-record-id-file=s',
'mfhd',
'all',
'replace_001',
in their ID sequences.
Usage: $0 [options]
- --help or -h This screen.
- --config or -c Configuration file [@sysconfdir@/opensrf_core.xml]
- --format or -f Output format (USMARC, UNIMARC, XML, BRE, ARE) [USMARC]
- --encoding or -e Output encoding (UTF-8, ISO-8859-?, MARC8) [MARC8]
- --xml-idl or -x Location of the IDL XML
- --timeout Remains for backward compatibility. No longer used.
- --type or -t Record type (BIBLIO, AUTHORITY) [BIBLIO]
- --all or -a Export all records; ignores input list
- --replace_001 Replace the 001 field value with the record ID
- --store Use the given storage backend to connect to the database.
- Choices are (reporter, cstore, storage) [reporter]
- --since Export records modified since a certain date and time.
+ --help or -h This screen.
+ --config or -c Configuration file [@sysconfdir@/opensrf_core.xml]
+ --format or -f Output format (USMARC, UNIMARC, XML, BRE, ARE) [USMARC]
+ --encoding or -e Output encoding (UTF-8, ISO-8859-?, MARC8) [MARC8]
+ --xml-idl or -x Location of the IDL XML
+ --timeout Remains for backward compatibility. No longer used.
+ --type or -t Record type (BIBLIO, AUTHORITY) [BIBLIO]
+ --all or -a Export all records; ignores input list
+ --replace_001 Replace the 001 field value with the record ID
+ --store Use the given storage backend to connect to the database.
+ Choices are (reporter, cstore, storage) [reporter]
+ --since Export records modified since a certain date and time.
+ --exclude-record-id-file Specify a file containing list of record ids to exclude
Additional options for type = 'BIBLIO':
--items or -i Include items (holdings) in the output
if ($opts{format} eq 'BRE' && $opts{items}) {
die "Format BRE is not compatible with exporting holdings."
}
+ $opts{'exclude-record-ids'} = {};
+ if ($opts{'exclude-record-id-file'}) {
+ if (-e $opts{'exclude-record-id-file'}) {
+ open FILE, $opts{'exclude-record-id-file'};
+ while (my $record_id = <FILE>) {
+ chomp $record_id;
+ $opts{'exclude-record-ids'}->{$record_id} = 1;
+ }
+ close FILE;
+ } else {
+ die "Could not find file for exclude-record-id-file: " . $opts{'exclude-record-id-file'};
+ }
+ }
+
if ($opts{'exclude-itemless-bibs'} && ! $opts{items}) {
die "If excluding itemless bibs, must export holdings.";
}
# until we run out. These sres "go with" the previous bib record.
if ($Marque::config->option_value('mfhd') && $self->{mfhds} && @{$self->{mfhds}}) {
$r = shift(@{$self->{mfhds}});
+ if (defined $Marque::config->option_value('exclude-record-ids')->{ $r->id() }) {
+ import MARC::File::XML; # Reset SAX Parser.
+ return $self->next(); # skip this record
+ }
eval {
$marc = MARC::Record->new_from_xml($r->marc(),
$Marque::config->option_value('encoding'),
my $data = $self->{sth}->fetchrow_hashref;
if ($data) {
$r = $self->{breClass}->from_bare_hash($data);
+ if (defined $Marque::config->option_value('exclude-record-ids')->{ $r->id() }) {
+ import MARC::File::XML; # Reset SAX Parser.
+ return $self->next(); # skip this record
+ }
if ($Marque::config->option_value('format') eq 'BRE') {
$output = OpenSRF::Utils::JSON->perl2JSON($r);
} else {
if ($data) {
my $format = $Marque::config->option_value('format');
my $are = $self->{fmClass}->from_bare_hash($data);
+ if (defined $Marque::config->option_value('exclude-record-ids')->{ $are->id() }) {
+ import MARC::File::XML; # Reset SAX Parser.
+ return $self->next(); # skip this record
+ }
if ($format eq 'ARE') {
$output = OpenSRF::Utils::JSON->perl2JSON($are);
} else {