Sili
Joined: 28 May 2009 Posts: 1
|
Posted: Thu May 28, 2009 5:34 pm Post subject: Conditionally Incrementing/Renaming Movie Files? |
|
|
First of all, let me thank you for making what seems to be a fantastic versatile program. Releasing it as freeware is a very noble thing to do when it seems like everyone is out to make a quick buck today.
Now that I've gotten that out of the way, let me explain my dilema a little bit
I've got a little over 900 Avi files on a hdd that I'd like to do a mass rename on. I normally wouldnt care so much about the filenames as the folders themselves are all organized the way I want them, but I need to get the filenames proper for a media center's library mode to display them properly (xbmc).
Here's an example of how the folder/file structure looks:
Movies\
->Movie A\
-->randomfilename.avi
->Movie B\
-->randomfilename-a.avi
-->randomfilename-b.avi
->Movie C\
-->randomfilename.1.avi
-->randomfilename.2.avi
->Movie D\
-->filename-a-moretext.avi
-->filename-b-moretext.avi
and tons of other variants...everything from spaces/dashes/underscores to the location of the a,b,c/1,2,3/etc label.
What I need to be able to figure out how to do is rename all the files to their folder name (easy enough, I've figured that part out), but in instances where there's more than one file to append -CD1/-CD2/-CD3/etc to the filenames when there are more than one file located in the directory. Single files are fine as the foldername itself, its just the multi CD movies that need to be labeled as such. Due to the variation of filenames and my inexperience with regular expressions i'm at a loss on how to get this accomplished.
Any help would be greatly apriticated, at this point my only other option is to go in by hand and rename the movies (something I was doing up until I grew frustrated at the amount of time it was taking and decided to google around a bit). I did a few searches around your forums but was unable to find anything that I could use. |
|
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Fri May 29, 2009 3:28 am Post subject: |
|
|
Renaming the files so that they are appended with CD1/2/3 can be easily done however, it would be done for every file in each folder.
If you don't want the CD1 for lone files of a folder, then would to write a plugin. the plugin could be the last command of the sequence and it could check if there is only one file in the folder; if there is then change the name being processed so that the CD1 is removed.
Peter. |
|