I have multiple file like below in linux

    > Aardvark_GENES_D.fa.1
    > Aardvark_GENES_D.fa.2 
    > Aardvark_GENES_D.fa.3
    > Aardvark_GENES_D.fa.4

I want to rename them by removing last extension and editing string like below

    Aardvark_ACMSD_D.fa
    Aardvark_ARID1B_D.fa
    Aardvark_CRYM_D.fa
    Aardvark_SMO_D.fa

Kindly help me how to do so ?????
assuming list.txt contains the name of the gene in the correct order

    paste  <(ls  *.fa.* | sort -t '.' -k3,3n ) list.txt  | awk  '{split($1,a,/_/); printf("mv %s %s_%s_%s\n",$1,a[1],$2,a[3]);}'  | sed 's/\.[0-9]*$//'
    
    mv Aardvark_GENES_D.fa.1 Aardvark_ACMSD_D.fa
    mv Aardvark_GENES_D.fa.2 Aardvark_ARID1B_D.fa
    mv Aardvark_GENES_D.fa.3 Aardvark_CRYM_D.fa
    mv Aardvark_GENES_D.fa.4 Aardvark_SMO_D.fa



when you're happy with the result, pipe it into 'bash'
