projects
/
webpac2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e643d01
)
convert file from command-line argument
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Apr 2015 15:39:17 +0000
(17:39 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Apr 2015 15:39:17 +0000
(17:39 +0200)
scripts/mab2marc.pl
patch
|
blob
|
history
diff --git
a/scripts/mab2marc.pl
b/scripts/mab2marc.pl
index
cf94618
..
9dd4b68
100755
(executable)
--- a/
scripts/mab2marc.pl
+++ b/
scripts/mab2marc.pl
@@
-6,8
+6,14
@@
use MARC::Record;
use Encode;
use Data::Dump qw(dump);
-open(my $m21, '<', 'agram-3.m21');
-open(my $out, '>:encoding(utf-8)', 'agram-3.marc');
+my $source = shift @ARGV || die "usage: $0 file.m21\n";
+my $dest = $source;
+$dest =~ s/\..+/.marc/;
+
+open(my $m21, '<', $source);
+open(my $out, '>:encoding(utf-8)', $dest);
+
+warn "# convert $source => $dest\n";
my $last_id;
my @fields;