Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 2nd December 2011, 05:21
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 223
Thanks: 11
Thanked 10 Times in 10 Posts
Default Batch Rename all mp3's in a directory

I need to rename several hundred mp3's in a directory. I've tried this php script...but it seems to have missed every file from 19 to 29 (119-129, 219-229, 319-329 etc).

The original names are in no particular order or fashion in how they're named.

What's my best choice to rename these files to song1.mp3, song2.mp3 song3.mp3 etc.?

PHP Code:
<?php
$i 
1;
foreach (
glob("/xmas/*.mp3") as $filename) {
copy ("$filename""/newpopaudio/xmas$i.mp3");
$i++;
}
?>
Reply With Quote
Sponsored Links
 

Bookmarks

Thread Tools
Display Modes

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 Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webmin upgrade lishaw1968 Installation/Configuration 15 26th August 2010 15:23
Email problem 'Cannot set my user or group id.' (using ISPConfig 3 + OpenSuSE 11.2) urosm Installation/Configuration 5 19th June 2010 22:41
can't help ispconfig to install please help steve51184 Installation/Configuration 17 20th February 2009 10:37
ISPConfig install issues... flyingaggie Installation/Configuration 2 18th July 2008 10:46
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 17:17


All times are GMT +2. The time now is 04:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.