From 8e813de1f6497f0111286a2d751f9c543b4f2871 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 14 Sep 2016 09:59:42 -0400 Subject: [PATCH] filter out linefeeds and carriage returns from holding tag values Signed-off-by: Jason Etheridge --- extract_holdings | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extract_holdings b/extract_holdings index f99b08d..619aec1 100755 --- a/extract_holdings +++ b/extract_holdings @@ -92,7 +92,7 @@ sub extract_holdings { for my $value ( @{$rec->{tags}[$holdidx]{multi}{$sub}} ) { my $fh = $MULTIFILE{"$tagid$sub"}; my $clean_value = $value; - $clean_value =~ s/\t//g; + $clean_value =~ s/[\r\n\t]//g; print $fh join("\t", $rec->{egid}, $j, $clean_value), "\n"; } } @@ -143,7 +143,7 @@ sub extract_holdings { for my $value ( @{$rec->{tags}[$tag_idx]{multi}{$sub}} ) { my $fh = $MULTIFILE{"$othertag$sub"}; my $clean_value = $value; - $clean_value =~ s/\t//g; + $clean_value =~ s/[\r\n\t]//g; print $fh normalize_output(join("\t", $rec->{egid}, $j, $clean_value)), "\n"; } } -- 1.7.2.5