rename a file with new extension

Hi guys,

i had many files like filename.20110520_20110519_050030

i have to rename the file by removint the last numerics ..

i.e filename.dat

i tried with cut command and removed the numerics but i'm not able to add .dat to the files.

is there any command insted of cut command to rename the file names
thanq..
venkat

try this :wink:

a="filename.20110520_20110519_050030"
# echo ${a%.*}
filename