Hi,
This code should satisfy your demand:
Data are in a hash whose key is the ID and associated value
is an array with the first elements being the name and the desc, and the next ones being the application-names)
# ------------------------------------------------------------
%Struct = ();
open (IN, "Abnova_Product_List.txt");
while(<IN>)
{
chomp($_);
($Key,$Name,$Desc,$OneApp) = split(/\t/,$_);
if (! exists $Struct{$Key})
{
$refArray = [$Name,$Desc,$OneApp];
$Struct{$Key} = $refArray;
}
else
{
$refArray = $Struct{$Key};
push (@$refArray,$OneApp);
}
}
close(IN);
open (OUT, ">Abnova_Products.txt");
foreach $Key (keys %Struct)
{
$refArray = $Struct{$Key};
print OUT "K=$Key\t".join("\t",@$refArray)."\n";
}
close (OUT);
There are no "my" are they yours ????
Enjoy ;-)