=================================================================== RCS file: /cvs/pta/pta_import.pl,v retrieving revision 1.19 retrieving revision 1.20 diff -u -p -r1.19 -r1.20 --- pta/pta_import.pl 2020/11/22 01:48:36 1.19 +++ pta/pta_import.pl 2020/11/23 14:14:23 1.20 @@ -156,7 +156,7 @@ $banks{$account_name} or die "unknown accountname: $ac # Parse the configuration file. my $fn = "import_" . $account_name . ".txt"; open my $in, '<', $fn or die "$fn: $!"; -my ($csv_account, $delim, $header, $quote, @compiled); +my ($csv_account, $delim, $header, $quote, @compiled, @ignored); while (<$in>) { chomp; next if /^(?:#|$)/; @@ -181,6 +181,10 @@ while (<$in>) { $quote = $1; next; } + if (/^IGNORE\s+(.*)/) { + push @ignored, qr/$1/; + next; + } $delim or die "no DELIM line in $fn"; s/^(.*)$delim\s+(\d+)\s+(\S+)// or die "$fn import parse error: $line"; @@ -194,9 +198,12 @@ close $in; $csv_account or die "no ACCOUNT line in $fn"; # Parse the CSV file from the bank. -while (<>) { +LINE: while (<>) { chomp; next if (/^$/); + foreach my $ignore (@ignored) { + next LINE if /$ignore/; + } my $line = $_; if ($header) { $line eq $header