Checking for a control file before processing a data file

Hi All,
I am very new to Shell scripting...
I got a requirement.
I will have few text files(data files) in a particular directory. they will be with .txt extension. With same name, but with a different extension control files also will be there. For example, Sample_20081001.txt is the data file, then Sample_20081001.ctl will be the control file.
Now if the ctl file exists, then only i have to move that particular txt file into another directory. Others i should not move. And the .txt and .ctl files will be multiple. This is my requirement.

Can anybody please give a solution?
Thank you very much.

Try :

for each in $(ls -1 *.ctl)
do
[[ -f "${x%%.ctl}.txt" ]] && { mv ${x%%.ctl}.txt ./new_folder/ }
done

Dear Dennis,

Thank you for a prompt response....

Can you tell me wht x%% refers... As i am new to shell scripting, i am not able to understand the code snippet you have given...
Can you please explain how this works... So that i can tailor it according to my requirement....

Thank you...

Sorry, It was a typo, the modified script is

#look for all the .ctl files
for each in $(ls -1 *.ctl)
do
#extract the filename without ctl extention and search for {filename}.txt 
# if it is there, move to a different folder
[[ -f "${each%%.ctl}.txt" ]] && { mv ${x%%.ctl}.txt ./new_folder/ }
done

Thanks Dennis... It works for me fine...