need to move files of particular day from one dir to another dir

Hi,

I have hundered's of files of the name
CMP_PORT_IN_P200903271623042437_20090328122430_err.xml in error directory of todays date ie 20090328 and in the file name 5th field specifies date only now i want to move all files of 20090328 to another directory i.e reprocess directory.

So please help me how it can be done.

Thanks

Is this command
mv `find CMP_PORT* -mtime 0` ../xmlreprocess

will move the files of today's date?

Backticks suck. Also, there's no need for find, if they're all in the same directory.

mv *_$(date +%Y%m%d)*.xml ./xmlreprocess

We may need to be more specific to avoid the chance of false matches and avoid making the command line too long when there are hundreds of files.

ls CMP_PORT_IN_P??????????????????_22090328??????_err.xml | while read FILENAME
do
       # Remove echo if the command does what you want 
       echo mv "${FILENAME}" reprocess_dir
done