View previous topic :: View next topic |
Author |
Message |
greg32 Apprentice
Joined: 26 Mar 2003 Posts: 259 Location: Australia
|
Posted: Thu Jan 15, 2004 10:29 pm Post subject: re-name huge ammount of files |
|
|
Hi,
I have a lot of mp3 files (thousands). Some are names as per the songs, and most of them are named just with numbers (i.e. 1,2,3,4,02,03,04...). They are all over the place. I want to copy them into one directory, but because there are lots of 01's, and 1's and 02's... there will be a big head ache with the same files names. Is there a way that I can rename a large ammount of files in one go, and at the same time, tell the rename command to give them the name 1,2,3,4,5,6.... in sequence as it is doing it, so that they all end up in order, and only one file has the one number as it's name, so that I can store them in one directory??? I hope this makes sense.
regards Greg |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Thu Jan 15, 2004 10:33 pm Post subject: |
|
|
You could do this with some bash magic. Or simply use the RenameSeq-Button in the gentoo-Filemanager (is in portage) .... |
|
Back to top |
|
|
David_Escott l33t
Joined: 12 Jan 2003 Posts: 952 Location: Boston, MA
|
Posted: Thu Jan 15, 2004 10:36 pm Post subject: |
|
|
$count=0;
for dir in directory1 directory2 directory3 etc...
do
for f in ~/$dir/*.mp3
do
mv ~/$dir/$f ~/dest/$count.mp3;
count= $(( $count + 1 ));
done
done
I'm sure there are better ways to do this. But that would put you on the basic track. Also searching the forums for rename and mmv will bring up lots of stuff about those two programs. |
|
Back to top |
|
|
TheEternalVortex Apprentice
Joined: 15 Oct 2002 Posts: 207 Location: San Jose, CA
|
Posted: Fri Jan 16, 2004 12:07 am Post subject: |
|
|
You could do this in perl. It would also be easy to rename based on ID3 tags or anything like that too. _________________ -- Andy |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|