![]() |
|
|
|
Semper drive!
|
Windows Utility For Mass File Renaming Job
I've been assigned a task of standardizing the file names for several thousand music files for an organization I'm associated with. The files have been stored in two separate locations, and we're working on combining them in one place, giving access to each location over a network.
A few thousand of the files have been named in a format describing the artist, track number and then song title, like this: Artist - 01 - Name Of Song.MP3. A lot more of the files (over 30,000 of them) have been named describing track number, artist, and then song title, like so: 01 - Artist - Name Of Song.MP3. Does anyone know of a program that can handle the renaming function like this of a large amount of files? I've heard IrfanView has a pretty robust file re-naming feature, but can it handle something like this? Basically, renaming several thousand files from Artist - 01 - Song Title.MP3 to 01 - Artist - Song Title.MP3 Thanks Randy
__________________
84 944 - Alpine White 86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten ![]() One Marine's View Igitur qui desiderat pacem, praeparet bellum |
||
![]() |
|
Back in the saddle again
Join Date: Oct 2001
Location: Central TX west of Houston
Posts: 55,951
|
I would think that if you can't find an app, that you could probably find someone to write you a quick script in pearl or something like that that could do the rearranging for you.
__________________
Steve '08 Boxster RS60 Spyder #0099/1960 - never named a car before, but this is Charlotte. '88 targa ![]() |
||
![]() |
|
Semper drive!
|
Thanks, Steve! I considered some sort of Perl routine, but unfortunately my skills with Perl go as far as running an "ls" or "lst" command to see what files are there.
![]() Randy
__________________
84 944 - Alpine White 86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten ![]() One Marine's View Igitur qui desiderat pacem, praeparet bellum |
||
![]() |
|
Get off my lawn!
|
We found a program to do that a couple of years ago. Are you using a Mac or Windows computer?
__________________
Glen 49 Year member of the Porsche Club of America 1985 911 Carrera; 2017 Macan 1986 El Camino with Fuel Injected 350 Crate Engine My Motto: I will never be too old to have a happy childhood! |
||
![]() |
|
Semper drive!
|
Using Windows, Glen.
Randy
__________________
84 944 - Alpine White 86 Carrera Targa - Guards Red - My Pelican Gallery - (Gone, but never forgotten ![]() One Marine's View Igitur qui desiderat pacem, praeparet bellum |
||
![]() |
|
Registered
|
Windows can do this, 300k is not that big of a number. Just write a simple batch script like:
# START OF SCRIPT # Declare input arguments. var str dir pattern # Collect a list of files matching the pattern. var str list find -f $pattern $dir >$list # The list of files is in $list. Process one at a time. while ($list <> "") do # Get the next file. var str file, path, old_name, new_name lex "1" $list > $file # Remove path. This will give us just the file name in $old_name. stex -p "^/^l[" $file > $old_name # After (but excluding) the last / # Drop the first 7 characters. chex -p "7]" $old_name > $new_name # Insert MSG_IN_ after 14 characters. chin "14" "MSG_IN_" $new_name > null # We are using > null because we dont want to see the output # We want to insert MSG_IN_ into $new_name (thus no -p option). script SS_SlashBack.txt ospath($file) >$file # Rename $file to $new_name system rename $file $new_name # END OF SCRIPT I stole this from another site because I didn't fell like typing it out, but this is a basic way to do it. You could of course then schedule it as a job inside of windows and have it run whenever.
__________________
2021 Model Y 2005 Cayenne Turbo 2012 Panamera 4S 1980 911 SC 1999 996 Cab |
||
![]() |
|
![]() |