find,replace and default

Hi
Can you please help on this ?

sach.txt:
--------

temp_tab_a.column01=temp_tab_b.column21
temp_tab_c.column01=temp_tab_b.column22
temp_tab_d.column01=temp_tab_c.column32
temp_tab_*.......... goes further

I want to replace temp_tab_a with A, temp_tab_b with B and other alias(temp_tab_*) with X (default value) . The file we are going to replace has multiple lines like the above. It should look like the below.

A.column01=B.column21
X.column01=B.column22
X.column01=X.column32

The file we are going to replace has multiple lines like the above. We want a script that handles multiple lines like the above.

Thanks
Sakthifire

sed -e s/temp_tab_a/A/g -e s/temp_tab_b/B/g -e s/temp_tab_[c-z]/X/g sach.txt

Regards,
VG

a bit change to vguleria's solution

sed -e 's/temp_tab_a/A/g' -e 's/temp_tab_b/B/g' -e 's/temp_tab_[^ab]/X/g' 

i think below perl may a little bit faster, since only go through the whole file once.

while(<DATA>){
	s/temp_tab_([^.]*)/($1 eq 'a')?'A':($1 eq 'b')?'B':'X'/eg;
	print;
}
__DATA__
temp_tab_a.column01=temp_tab_b.column21
temp_tab_c.column01=temp_tab_b.column22
temp_tab_d.column01=temp_tab_c.column32