If you want to move .txt to .cf then use as below.
mv “${file_name}” “${file_name%txt}cf”
or
base name can also help....
mv "$file" "$(basename "$file" .txt).cf"

But defenetly, you need to use a loop as below for moving all files in a directory:-
for file_name in *.txt
do
echo “changing file_name extensions from .txt to .cf”
mv “${file_name}” “${file_name%txt}cf”
done

or if ir is basename...
#!/bin/bash
DIR=/var/tmp
cd $DIR
ls -l > /var/list
file=`cat /var/list | grep .txt | cut -d: -f2 | cut -c4-`
for file in $file
do
mv "$file" "$(basename "$file" .txt).text"
done

but you are speaking in case of Prefix. so try teh opposite way around.