uno = uno,eins
due = dos,zwei
tre = tres,drei
quattro = quatro
cinque = cinco,funf
sei = seis,
sette = siete,sechs
otto = ocho
nouve = nueve, neun
dieci = diez, zehn
undici = once, elf
dodici = doce
tredici = trece, dreizehn
####
due =deux, two,
tre = trois,drei, three
quattro = quatre,four
cinque = cinq,funf, five
sei = six , six
sette = sept , seven ,sechs
dieci =dix
undici = onze,eleven
tredici = treize,thirteen, dreizehn
##
##
use strict;
use warnings;
#declare variables
my %hash;
my $data;
#opening Files
open my $in, '<',"./Test_Data_RanNumbers.txt" or die ("can't open the file:$!\n");
open my $in1,'<',"./Test_Data_More_RanNumbers.txt" or die ("can't open file : $!\n");
open my $out ,'>' ,"./Test_Data_Out_Ita_SpanFrenEngGer.txt" or die "can't open the file for write:$!\n";
open my $out1,'>',"./Test_data_out_Ita_SpanFren.txt" or die "can't open the file :$!\n";
open my $out2,'>' , "./Test_Data_Out_None_Match.txt" or die "can't open file for write:$!\n";
while ($in){
#data manipulation to clean up ='s and ,'s
#dieci = diez, zehn -->worse case, remove spaces and = and comma;
#quattro = quatro -->only one number with spaces or not in from of =...
chomp($data);
my ($ita,$spa,$num)= split(/[=\s,]+/,$data); # removes '=' or 's' or ',' & '+' to match 1 or more these characters
$hash{$ita}[0]=$spa;
$hash{$ita}[1]=$num; #keeping it for check later if "defined" | will be undef if not
}
close $in;
while ($in1){
chomp($data);
my ($ita,$fren,$num)= split(/[=\s,]+/,$data);
$hash{$ita}[0]=$fren;
$hash{$ita}[1]=$num; #keeping for check later checks programming
}
close $in1;
foreach my $ita (keys %hash){
if($hash{$ita}[0] and $hash{$ita}[1]){
print "$ita =>", join(',',@{$hash{$ita}}),"\n";
}else {
print "$ita =>",join(',',@{$hash{$ita}}),"\n";
}
}