Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions marc-record/bin/marcdump
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ if ( $opt_help || !@files || !$rc ) {
exit 1;
}

@opt_field = map { _update_field_wildcards( $_ ) } @opt_field;
my $wants_leader = grep { /LDR/ } @opt_field;

my $class = $opt_lif ? "MARC::File::MicroLIF" : "MARC::File::USMARC";
Expand Down Expand Up @@ -184,6 +185,13 @@ sub _hex_line_output {
printf( "%05d: %-$width.${width}s %s\n", $offset, $hex, $ascii );
}

sub _update_field_wildcards {
my $field = shift;
if ($field =~ /^[0-9X]{3}$/) {
$field =~ s/X/./g;
}
return $field;
}

__END__
Usage: marcdump [options] file(s)
Expand All @@ -195,6 +203,7 @@ Options:
--field=spec Specify a field spec to include. There may be many.
Examples:
--field=245 --field=1XX
--field=LDR --field=1..
--[no]quiet Print status messages
--[no]stats Print a statistical summary by file at the end
--version Print version information
Expand Down