View previous topic :: View next topic |
Author |
Message |
Uncle_Psychosis Guru
Joined: 31 Jan 2004 Posts: 387
|
Posted: Tue Aug 03, 2010 6:29 pm Post subject: Renaming thousands of files in nested directories... |
|
|
Hi guys
Due to me being an absolute muppet and making a typo in my abcde.conf all of my mp3s have got backslashes in the filename. This has caused a problem because the latest version of phonon/amarok can't cope with it and won't play those tracks.
Now, rather than manually rename thousands of files, I was wondering if anyone had a clever way to fix this?
Basically, the files are named like this:
Code: | 01\ Example_Artist\ -\ Example_Song_Title.mp3 |
when I want them to be named like
Code: | 01 Example_Artist - Example_Song_Title.mp3 |
Any tips?
Also, to add an extra level of complexity the files are all nested within a directory structure:
~/mp3/ripped/$ARTIST/$ALBUM
So there are X amounts of artists, each with Y numbers of subdirectories corresponding to each album...
Anyone help me out? |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Aug 03, 2010 6:31 pm Post subject: |
|
|
find ~/mp3/ripped -name "*\\ *.mp3" -exec rename "\\ " " " "{}" \; |
|
Back to top |
|
|
Uncle_Psychosis Guru
Joined: 31 Jan 2004 Posts: 387
|
Posted: Tue Aug 03, 2010 6:37 pm Post subject: |
|
|
frostschutz wrote: | find ~/mp3/ripped -name "*\\ *.mp3" -exec rename "\\ " " " "{}" \; |
That removes the first back slash... I take it I can just run it three times and it'll fix all three?
I owe you a huuuuuuuuuge thanks by the way. |
|
Back to top |
|
|
|