Rename multiple files

view story

http://www.unix.com – Hi. I have a large number of files with names like: t_ 0.20000E-02.dat There is actually a space after the underscore. These files are numbered numerically, i.e. t_ 0.20000E-02.dat, t_ 0.21000E-02.dat, t_ 0.22000E-02.dat and so on. What I would like to do is rename such that the file with the lowest numerical value becomes t1.dat, and the one next to it becomes t2.dat and so on. I think what I have to do is find the number of files in the directory and sort them according to their numerical value. Then I have to do a loop over them to rename them accordingly. But this seems to be quite inv (HowTos)