Help needed with File Watcher script

Hi all,
I am writing a script to do the following:
1) Check if there are any new <csv> files (in abc directory) to process
2) If there is new file, then perform some operation on that file.
3) Move it to a different location(after step2 is successful)
4) Do further processing on the file

Problem is that there can be either one or more <csv> files that will be available in this directory.
All the above steps need to be performed on each new file.

Not sure how i could do this on multiple files

This is how i wrote the script...The script is not coming out of the loop when running this...

while true
do
  for file in *.csv;
    do
     #Some operation 
   mv $file /xxx/yyy
   #some operation
   done
  sleep 10
  done 

PLEASE HELP!!!!!
Thanks in Advance!!!

---------- Post updated at 05:28 PM ---------- Previous update was at 05:12 PM ----------

Hi Guys..I found this in the forum which i think is similar to what im trying to do...but Im not sure how i need to make the script exit when there are no files in that directory to process...Is there a way to do that?? PLEASE let me know!!!

while true
do
    file_list=$( ls file1_* 2>/dev/null )
    if [ -n "$file_list" ] ; then
        for file_name in $file_list ; do
            echo "Processing $file_name"
            #run some command...
            if [ $? -eq 0 ] ; then
                mv $file_name .done/ # Assume .done dir
            else
                mv $file_name .error/ # Assume .error dir
            fi
        done
    fi
    sleep 2
done

THANKS in advance!!!!

Just cut out the while true loop around the whole thing, think you want something like this:

file_list=$( ls *.csv 2>/dev/null )
if [ -n "$file_list" ] ; then
  for file_name in $file_list ; do
      echo "Processing $file_name"
      #run some command...
      if [ $? -eq 0 ] ; then
          mv $file_name /xxx/yyy/
          # run some other operation
      else
          mv $file_name /xxx/error_dir/
       fi
  done
fi

Thanks for replying...

This is what i think the script does when i cut out the "while true" statement

Say if i have 3 new files available..then this script will process each file and then exit...but if i do it this way then i need to kick it off manually whenever i know there are new files...right???

Please correct me if im wrong!!!

Thank You!!!!!