Question....

3 views
Skip to first unread message

Cor

unread,
Feb 12, 2012, 4:42:34 PM2/12/12
to
Hello guys,

My question is: I have a great amount of mp3 files, that are named the wrong
way round, i.e.
Frankie - Sister Sledge.
But the bulk of my other mp3 files (about 155000) is named Sister Sledge -
Frankie. In other words: Artist first, space, dash - filename.mp3.

Is there a way to turn these files around automatically using some sort of
DOS-commando?
I don't see myself renaming appr. 2500 mp3's by hand....

Thanks in advance!!

Cor

Tax...@Versatel.nl


DOS Guy

unread,
Feb 12, 2012, 5:41:57 PM2/12/12
to
Cor wrote:

> My question is: I have a great amount of mp3 files, that are named
> the wrong way round, i.e.
> Frankie - Sister Sledge.
> But the bulk of my other mp3 files (about 155000) is named
> Sister Sledge - Frankie.
> In other words: Artist first, space, dash - filename.mp3.
>
> Is there a way to turn these files around automatically using some
> sort of DOS-commando?

> I don't see myself renaming appr. 2500 mp3's by hand....

What I would do is this:

Open a command prompt and navigate to the directory containing your mp3
files and issue the command:

dir *.mp3 /b > dir.txt

That will create a text file containing a list of the names of all the
mp3 files.

Now, if you have excel (or any spreadsheet program) do this: Open the
file "dir.txt" and when asked how to read the file, select "delimited".

Choose "-" and "." as your delimiter characters.

The file will then be read in, with the first part of the file (the name
of the track) put into it's own column (column A) followed by the name
of the group in the next column (column B) followed by "mp3" in the
third column (column C).

Any file that does not have a "-" in the name won't be processed
correctly according to this scheme, and neither will any file name that
has more than 1 "-" character.

Once the names are read in, you can insert extra columns and copy the
columns to create your batch commands.

What you want is to have this in column A/B/C/D/E/F/G/H/I/J:

Rename/track/-/artist/mp3/" "/artist/-/track/./mp3

So in these columns, put these:

a) Rename
b) track
c) - (dash)
d) mp3
e) " " (space character)
f) artist
g) - (dash)
h) track
i) . (dot)
j) mp3

Then save the file as an MS-DOS text file (save it also as .xls just in
case you screw up). Call it "rename-mp3.txt".

If you then edit the file in notepad, look for double-space characters
and spaces that shouldn't be there. You can perform global
search/replace if necessary. Then rename the file to "rename-mp3.bat"
and then run the file. But again, give it a good read to make sure it's
going to rename them properly before you execute it.

billious

unread,
Feb 12, 2012, 5:42:54 PM2/12/12
to

"Cor" <Tax...@Versatel.nl> wrote in message
news:4f383250$0$15199$bf49...@news.tele2.nl...
Oh, much better to give a more explicit title to your thread - many
respondent simply disregard "Question" or similar - after all, most threads
posted are questions, so it doesn't impart much information.

I'd try alt.msdos.batch.nt where similar problems have been solved before -
but they may be buried in the history. Try looking for threads with a title
including "file rename" or something similar. They may be threads titled
'Question' - but they're likely not to be as helpful...

Primitively, this batch may be a start:

@echo off
setlocal enabledelayedexpansion
for /f "tokens=1,2,3 delims=-." %%i in (
'dir /a-d/b *.mp3') do if not "%%k"=="" (
call :strip %%i
set track=!artist!
call :strip %%j
ECHO ren "%%i-%%j.mp3" "!artist! - !track!.mp3"
)
goto :eof
:strip
set artist=%*
goto :eof


BUT it relies on the absence of certain 'poison' characters (like ! for
instance) in either the artist or track name.

AND of course it's unable to INTELLIGENTLY distinguish between artist and
title, it will simply mechanically switch the two.

The ECHO keyword would need to be omitted to ACTUALLY rename the file. It's
normal practice in alt.msdos.batch.nt to simply echo the command to the
screen to avert tragedy if possible.


Message has been deleted

Cor

unread,
Feb 16, 2012, 4:00:10 AM2/16/12
to
Yes, please, I would love to have a program that can do the job!

"Jawade" <Henk_...@hotmail.com> schreef in bericht
news:20120212$230...@Jawade.Naaldwijk.nl...
> Cor <Tax...@Versatel.nl> schreef op Sun, 12 Feb 2012 22:42:34 +0100 in
> artikel <4f383250$0$15199$bf49...@news.tele2.nl>:
> First: You have to sort out the files with the title first and the
> files with the artist first. No any program or script can recognize
> if it is a title or an artist.
> Second: All filenames need to have ' - ' (space, dash, space).
>
> If that is correct, I can write a program who can do the job.
>
>
> Met vriendelijke groeten, Jawade.
> --
> Nieuw! hosts file manager, voor bewerken enz. In 2012 veel vernieuwd.
> http://jawade.nl/ HexEditor, Diskeditors+MBR-rebuilder, POP3lezer,
> Bootmanager (+Linux, +Engels), ClrMBR, SDir(DIRsize), Website-updater,
> Consolefilebrowsers, Kalender, USB-stick tester, Webtellers en IP-log.


Message has been deleted

Cor

unread,
Feb 18, 2012, 2:21:53 PM2/18/12
to
You are GREAT!!! Thank you very much!

"Jawade" <Henk_...@hotmail.com> schreef in bericht
news:20120216$225...@Jawade.Naaldwijk.nl...
> Cor <Tax...@Versatel.nl> schreef op Thu, 16 Feb 2012 10:00:10 +0100 in
> artikel <4f3d7672$0$26955$bf49...@news.tele2.nl>:
>> "Jawade" <Henk_...@hotmail.com> schreef in bericht
>> news:20120212$230...@Jawade.Naaldwijk.nl...
>> >
>> > First: You have to sort out the files with the title first and the
>> > files with the artist first. No any program or script can recognize
>> > if it is a title or an artist.
>> > Second: All filenames need to have ' - ' (space, dash, space).
>> >
>> > If that is correct, I can write a program who can do the job.
>>
>> Yes, please, I would love to have a program that can do the job!
>
> I've made it. It's here: http://jawade.nl/temp/mp3pm.exe
> Put the file in the directory of the mp3 files and start it. It
> turns the names like:
>
> Help - Beatles.mp3 -> Beatles - Help.mp3
>
> Maybe it's a good idea to make a backup first.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages