Go Back   PCMech Forums > Linux Support > Linux OS and Software Assistance

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 06-24-2001, 08:25 AM   #1
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Batch renaming of files

Okay here is the scoop. I have about 475 images, for some reason they are in the .jpeg format. I need to convert all the files over to a .jpg. Some of the images are .JPEG (caps). Others are lowercase. So I have file 1.JPEG, 2.jpeg, 3.jpeg that I need to convert to 1.jpg, 2.jpg, 3.jpg, etc.

Any ideas?
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 06-24-2001, 05:34 PM   #2
Registered User
 
Join Date: Mar 1999
Posts: 355
try using the rename command:

man rename

but, be warned, it will clobber any files that already exist. otherwise, you could write a little shell script to make mv a little smarter.
WickedLittleSlaveBoy is offline   Reply With Quote
Old 06-24-2001, 08:15 PM   #3
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
WLSB, glad to have you back around here. I really didn't intend on getting into a fracas with you on our last meeting here. So anyway if I have offended you forgive me.

I have not really played with the rename command before. It may be a moot point anyway but it is something fun to play with.
mairving is offline   Reply With Quote
Old 06-24-2001, 09:22 PM   #4
Registered User
 
Join Date: Mar 1999
Posts: 355
it was blown out of proportion.


the usage of rename would be something like:

rename .jpeg .jpg *.jpeg

which works out to rename &lt pattern you want to change &gt &lt pattern you want to change to &gt &lt files you want to change &gt
WickedLittleSlaveBoy is offline   Reply With Quote
Old 06-25-2001, 07:13 AM   #5
Premium Member
 
Statica's Avatar
 
Join Date: Jun 1999
Posts: 9,231
Mairving, Shell scripts are pretty easy to make or use Perl, here's an example I found.. which you can modify as u please.
http://www.tek-tips.com/gviewthread....d/80/qid/84527

or if thats complicated some apps like:
http://alfalinux.sourceforge.net/mrename.php3

HTH
Statica is offline   Reply With Quote
Old 06-25-2001, 07:44 AM   #6
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Statica, thanks. I have done some pretty simple shell scripts before.
mairving is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:30 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2