Find and replace duplicate column values in a row

I have file which as 12 columns and values like this

 
1,2,3,4,5
a,b,c,d,e
b,c,a,e,f
a,b,e,a,h

if you see the first column has duplicate values, I need to identify (print it to console) the duplicate value (which is 'a') and also remove duplicate values like below. I could be in two different scripts that fine.

 
1,2,3,4,5
a,b,c,d,e
b,c,a,e,f
,,e,a,h

Appreciate your help !

AWK version

awk -F, '{for (i=1;i<=NF;i++){if (v[i,$i]++){$i=""}};print $0}' OFS=","

Thanks for the reply kcoder.

Its not printing out the duplicate value

while(<DATA>){
	chomp;
	my @tmp = split(",",$_);
	for(my $i=0;$i<=$#tmp;$i++){
		if(exists $hash{$i}->{$tmp[$i]}){
			print "," if $i!=$#tmp;
		}
		else{
			print $tmp[$i];
			print "," if $i!=$#tmp;
			$hash{$i}->{$tmp[$i]}=1;
		}
	}
	print "\n";
}
__DATA__
1,2,3,4,5
a,b,c,d,e
b,c,a,e,e
a,b,e,a,h

It works, seems to be identifying duplicates overall. But I need to identify duplicates per column.

A slight modification to the post suggested by Kcoder24

 
awk -F, '{for (i=1;i<=NF;i++){if (v[i,$i]++){b[$i]=$i;$i=""}};print $0}  END { print "dups are" ;for ( i in b) print i}' OFS=","  input_file