1.

Solve : File Name Script Help?

Answer»

Can someone please help me.

I cannot WRITE code in MS-DOS and I need a script that will change all filenames within a folder and all subdirectories.

I need all MP3 file names in My Music and in subdirectories to be swapped around and keep the Dash in the middle, for example;

Blood On The Dancefloor - Michael Jackson
to become
Michael Jackson - Blood On The Dancefloor

I have tried bulk filename changers and they only use file tags and swap them round if you specify the names of each file.

Please help!

Regards

Darren HoskerQuote

Can someone please help me.

I cannot write code in MS-DOS

So learn how to.

use for loop with tokens,delimiters = '-'.
eg for "tokens= delims=-" %%a do (
set swapped=%%b - %%a
)

SOMETHING like that.....
For help, you can TYPE for /? and see how it worksThis would be a pretty advanced batch file. Here are some questions to see if we can make it easier:
Could any of the filenames have more than one '-' dash?
Could any of the filenames have more than one '.' period (any besides the .mp3)?
Could any of the filenames have more than one space before or after the '-' dash?
Could any of the filenames have no space before or after the dash?Hi Thanks for the reply.

In answer to the questions;

Could any of the filenames have more than one '-' dash? - Yes
Could any of the filenames have more than one '.' period (any besides the .mp3)? - No
Could any of the filenames have more than one space before or after the '-' dash? - Yes
Could any of the filenames have no space before or after the dash? - Yes

Although the answer to most of these is yes, I understand the complexity of the Batch file if you were to consider these. This would not really be important as it would just be the odd file out of 6,000 FILES, I could MANUALLY sort these its just the majority.

Cheers,

Darren


Discussion

No Comment Found