From 1d3a5acce3d324fe23879099b79906d2671c6b56 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 9 Apr 2015 17:39:17 +0200 Subject: [PATCH] convert file from command-line argument --- scripts/mab2marc.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/mab2marc.pl b/scripts/mab2marc.pl index cf94618..9dd4b68 100755 --- 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; -- 2.20.1