Peter=Pierre
John Baker=JeanBoulanger
Mary Brown Smith=Marie Brown
####
Matched file
JPeter=Pierre
Notmatched file
John Baker=JeanBoulanger(1)
Mary Brown Smith=Marie Brown(1)
####
#!/usr/bin/perl
use strict;
use warnings;
open(FILE, ") {
my ($left, $right) = split /=/, $line;
my @left_array = split / /, $left;
my @right_array = split / /, $right:
my $left_count = scalar @left_array;
my $right_count = scalar @right array;
if ($left_count == $right_count) {
print $matched_file $line;
} else {
chomp $line;
my $diff = abs (left_count - $right_count)
print $unmatched_file $line, "($diff) \n";
}
}