batch renaming of files
Hi,
I've got a number of photos that need changing their names. What I need is a short script to change the names to 01.jpg, 02.jpg, etc. I've been trying to do it with 'rename' and 'move' but I can't get it right. Also, I've started learning python, and am courious how it would look in python. thanks |
Hello
Try something like this, it should work fine but I do not have time to try it out. Remember to try it on some dummy files first. Quote:
|
Thanks
however, I get the following error: Code:
loop=1; Code:
mv: `zdjecia/dsc_0546.jpg' and `zdjecia/dsc_0546.jpg' are the same file any ideas? thank you |
Right, the backticks should not be there.
Remove the backticks and it will work. Replace NEW_NAME=`$loop.$EXTENSION` with NEW_NAME=$loop.$EXTENSION |
Works perfect, thanks
|
The obligatory one-liner:
Code:
j=1;for i in *;do echo mv $i $j.jpg;j=$((j+1));done |
Quote:
Code:
import os |
Quote:
|
Quote:
|
thanks guys
|
All times are GMT -5. The time now is 03:53 PM. |