Dynamically creating file names from portions of another file name

Not sure how to do the following, but any help would be appreciated.
Has to be done using C shell (sorry about that).

I have about 300 files that I need this done for, but I am only going to give one example. I will just need to know how to execute your solution through some type of loop to get all three files.

I have a file named aaa.ccyymmdd.dat.gz.

I need to copy that file to a new name, but take the ccyymmdd out of the original filename and put it into the name of the new filename.

Final output would be xyz.ccyymmdd.dat.gz.

Example:

I have files:

aaa.20110101.dat.gz
aaa.20110401.dat.gz
aaa.20110701.dat.gz
aaa.20111001.dat.gz

and need to run something that will ls or list all the files, loop through them, copy the file over BUT name it:

xyz.20110101.dat.gz
xyz.20110401.dat.gz
xyz.20110701.dat.gz
xyz.20111001.dat.gz

MY BIGGEST CONCERN IS HOW TO SETUP THE LOOP.

Any help would be greatly appreciated.
Thanks.

awk is not shell dependent.

ls | awk -F. '{printf "mv "$0;$1="xyz";print " "$0}' OFS=. > rename.sh

you can verify the file and after that use

source rename.sh in the same directory.

Try this ->

foreach i ( `ls` )
echo cp $i $i:s/aaa/xyz/
end

cp aaa.20110101.dat.gz xyz.20110101.dat.gz
cp aaa.20110401.dat.gz xyz.20110401.dat.gz
cp aaa.20110701.dat.gz xyz.20110701.dat.gz
cp aaa.20111001.dat.gz xyz.20111001.dat.gz