HOWTO: Renaming files

For my 100th article, I’m gonna give away a program which renames all the files
matching a giving file extension. Useful mainly when you import your photos
from digital cameras where files are given random names. You must provide the
file extension and the new name. Made with Python is published under the terms of the GNU GPL license.
Example:
If you have in a directory:
2006_10_03_01.jpg
2006_10_03_02.jpg
and you provide the following prefix name= barcelona and file extension= jpg the result will be
barcelona_1.jpg
barcelona_2.jpg
Imagine when you have more than 500 files to rename. This program renames all the
files in less than a second.
Enjoy

Instructions:
Download the file renombra.txt
rename it to renombra.py
chmod +x renombra.py
./renombra.py (to run it)

renombra.txt

Advertisements

About jordilin

I'm a Senior Software Engineer with an MSc in Telecommunications Engineering. I've got a range of interests including Linux, a very powerful and limitless operating system, travelling, gastronomy and technology.
This entry was posted in HOWTOs, Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s