File renaming

steve3981

New Member
Does anyone know of a way to multi rename files in the format below

"Artist - Title.mp3" into "title - artist.mp3"
where the " - " is a common seperator

Any software that includes this function or any commands that can be used for this would be massively appreciated, thanks.
 

Quiltface

Active Member
you could create a batch file and do it...

rename file.mp3 file2.mp3
etc....


do this in a text document and save it as a .bat
run it.

but it you will still have to do pretty much most of it manually.... this will save you a little bit of time because you wont be doing the monotonous right click rename enter repeat jazz.

Eh then again you will have to type alot more.... i think you got a long night ahead of you.
 

tremmor

Well-Known Member
http://www.irfanview.net/

files / batch renaming

open all files. *.*

uses wild cards with parameters.

freeware

________________________
this software ive used for about 10 yrs.
lots of update and a huge plug in's available.
movie formats, pictures. you can download all pluggins.
works well when ya need it. resizing pictures etc.
its basic, but works well when ya need it.
 
Last edited:

tlarkin

VIP Member
you could create a batch file and do it...

rename file.mp3 file2.mp3
etc....


do this in a text document and save it as a .bat
run it.

but it you will still have to do pretty much most of it manually.... this will save you a little bit of time because you wont be doing the monotonous right click rename enter repeat jazz.

Eh then again you will have to type alot more.... i think you got a long night ahead of you.

That is why you would write a loop with a wild card most likely so it would only take a few lines of code to complete the whole batch file.

Windows Power Shell has a bunch of new command lines for batch jobs.

If this is on a Linux box I could write you a shell script.
 

tremmor

Well-Known Member
Your right. I remember now Tlarkin. it can be done
from explorer i think. In fact i just tried from explorer.
I loaded several into junk directory to play with.
highlight all, right click rename (no wild cards though).
No displacement either. it will easily do same name
then rename with 'beatles1' beatles2 and beatles3.
just another thought. the above program works well though.
and allows a displacement.

I don't know many that would be interested in creating
a batch dos file. works well. life is still simple with windows.
 
Last edited:

Quiltface

Active Member
That is why you would write a loop with a wild card most likely so it would only take a few lines of code to complete the whole batch file.

Windows Power Shell has a bunch of new command lines for batch jobs.

If this is on a Linux box I could write you a shell script.

But how would you do it with wild cards if he wants them all named with a Song - Artist.mp3 format without typing up all of the artist and song names already?
 

tlarkin

VIP Member
But how would you do it with wild cards if he wants them all named with a Song - Artist.mp3 format without typing up all of the artist and song names already?

you can use wild cards, but I don't think that is the best method. A loop would be the best method. You could wild card the directory path, like /path/to/music/* which would wild card all files beyond that path.

I would create a loop, do an if then, possibly cut out the name and then rearrange in the manner I wanted.

I could probably write this in shell, but I don't really know batch vocab nor do I know power shell that well. I'd have to learn it to whip a script out.
 

Quiltface

Active Member
that would be sweet, haven't heard from steve in a while... have you taken anything from this Steve?
 

tlarkin

VIP Member
that would be sweet, haven't heard from steve in a while... have you taken anything from this Steve?

Yeah I would need him to post an example file so I could see it, and anything I could write would only run in Unix/Linux/OS X because I really only know shell.

I could probably maybe write it in python or perl, and you can install that on a win box, but those aren't my strongest languages.
 

SenHu

New Member
Batch renaming artist, title in .mp3 files

Here is a quick script to rename all files "artist - title.mp3" into "title - artist.mp3". I am adding lots of comments so you can translate this script into any scripting language.

Code:
# Script ArtistTitle.txt
# Input argument - directory where all .mp3 files are located.
var str dir
# The script will rename all files that are UNDER this directory, that
# means files that are in subfolders, sub-subfolders, sub-sub-subfolders, tc.

var str list, file, name, artist, title, newname

# Collect a list of all files matching the pattern "*-*.mp3".
lf -r -n "*-*.mp3" $dir > $list

# Go thru files one by one.
while ($list <> "")
do

    # Get the next file.
    lex "1" $list > $file

    # Get just the file name. It is after the last /.
    stex -p "^/^l[" $file > $name

    # Remove the .mp3 part.
    stex -c "[^.mp3^" $name > null

    # Get the artist. It is before the dash.
    stex -p "]^-^" $name > $artist

     # Get the title. It is after the dash.
    stex -p "^-^[" $name > $title

    # The new name of the file is $title, then dash, then $artist, then .mp3.
    set $newname = $title + "-" + $artist + ".mp3"

    # Rename file from $file to $newname. We will wrap both names in
    # double quotes in case either name has space, etc.
    system rename ("\""+$file+"\"") ("\""+$newname+"\"")

    # We are done with this file. Next time around the loop, we will
    # automatically get the next file with the lex command, since
    # the next file is now the first line of $list.
done


The script may look big, but that's because I added lot of comments. The script is in biterscripting ( http://www.biterscripting.com ). Now, to try it, save the script in file C:/Scripts/ArtistTitle.txt, start biterscripting, and enter the following command.

Code:
scipt "C:/Scripts/ArtistTitle.txt" dir("C:/My MP3 Folder")


That's it. We are passing the value "C:/My MP3 Folder" to the input variable $dir. The lf (list files) command will list all the files matching the pattern "*-*.mp3" in this folder, and its sub and sub-sub folders. Each found file will then be renamed.

Use the correct path instead of "C:/My MP3 Folder" when calling the script. Enclose the path in double quotes.

Email me if you need more help.
 

tremmor

Well-Known Member
you can do it with the program above also. the displacement if wanted would do it without changing the names. like rolling stones10.mp3 rolling stones20.mp3 and rolling stones30.mp3. (the displacement is 10). it could be anything ya wanted. letters, numbers etc.
its worth looking at. like i said its freeware.
 

steve3981

New Member
Hi, I have tried the script and after a little frustration I have got it to work thankyou VERY much you saved me HOURS!!!

Thanks to everyone else with your comments, and sorry for not posting sooner I have been away.

Steve
 

zetlen

New Member
KrojamSoft BatchRenameFiles tool"

Does anyone know of a way to multi rename files in the format below

"Artist - Title.mp3" into "title - artist.mp3"
where the " - " is a common seperator

Any software that includes this function or any commands that can be used for this would be massively appreciated, thanks.


I know of a software that has that function
http://BatchRenameFiles.org
 

Dngrsone

VIP Member
Kind of an old thread... think maybe he's solved it in the past three years?

For the sake of argument though, I used a file manager in Ubuntu called Thunar which will rename .mp3 files in bulk uniformly according to their tag information.

Comes in real handy.
 
Top