From 429a7c2179e2c3c4fe9bfcbb52ebb22e55c8519a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 18 Mar 2021 12:17:55 +0100 Subject: [PATCH] =?utf8?q?MT940:=20Multi-Line-Varianten=20von=20Tag=2086?= =?utf8?q?=20unterst=C3=BCtzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/MT940.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SL/MT940.pm b/SL/MT940.pm index 2fbbad696..dd965deea 100644 --- a/SL/MT940.pm +++ b/SL/MT940.pm @@ -37,15 +37,25 @@ sub parse { } }; + my ($active_field); foreach my $line (read_file($file_name)) { chomp $line; $line = Encode::decode('UTF-8', $line); $line =~ s{\r+}{}; $line_number++; + my $current_field; + if ($line =~ m{^:(\d+[a-z]*):}i) { + $current_field = $1; + $active_field = $1; + } + if (@lines && ($line =~ m{^\%})) { $lines[-1]->[0] .= substr($line, 1); + } elsif (@lines && ($active_field eq '86') && !$current_field) { + $lines[-1]->[0] .= $line; + } else { push @lines, [ $line, $line_number ]; } -- 2.20.1