rename and arrange files based on a list
Hello
I have a bunch of video files,e.g.: a.avi b.avi c.avi And I have a list which has the right order of them,e.g.: c.avi a.avi b.avi I want to rename files based on position of them in the list,i.e.: 02.a.avi 03.b.avi 01.c.avi One line code would be appreciated :) |
Try this from the dir with the original files.
Code:
awk '{printf("mv \"%s\" \"%03d.%s\"\n",$0,NR,$0)}' <your-list-file> > temp.sh Code:
bash temp.sh |
Thanks,worked perfect
|
All times are GMT -5. The time now is 01:35 AM. |