I've got a series of files called Voyager - 3xx -EpisodeName.avi that need renaming to Voyager.S03Exx.EpisodeName.avi to make my DLNA server happy.
Any cmd line guru's able to come up with anything?
Si
Printable View
I've got a series of files called Voyager - 3xx -EpisodeName.avi that need renaming to Voyager.S03Exx.EpisodeName.avi to make my DLNA server happy.
Any cmd line guru's able to come up with anything?
Si
If this is just a one-off, I would probably use Renamer.
http://i.min.us/imM5jG.png
Are the episode names in any format, or any length etc? You could do wildcard renames in CMD, but easiest ways all have fixed lengths of wildcards, which I'm guessing you don't?
Could try to knock up a vbs version, or try to fix CMD, but our networks going offline today for repairs, so don't know how much time I'll have during day :P (or shout if you're using Renamer and I wont knock one :D)
Steve
@Arthur
Lovely find - just the job :)
Still like to know if there's a proper geeks way of doing it in XP cmd line though :)
Simon
Well, it's not elegant, but it should work....
You could probably get it down to a one-liner if you did a FOR /F tokens..... in (dir /b Voyager*) rename etc.Code:SETLOCAL ENABLEDELAYEDEXPANSION
for /L %%e in (1,1,99) do call :renfile %%e
goto :eof
:renfile
set e=%1
if %e% LSS 10 (
set episode=0%e%
) else (
set episode=%e%
)
rename "Voyager - 3%episode% -EpisodeName.avi" "Voyager.S03E%episode%.EpisodeName.avi"
Do you reckon this PowerShell script is geeky enough? :D
Edit. Need to figure out a way to do something similar to what Jinnantonnixx did with the series and/or episode numbers.Code:$regex = "^(Voyager)(?:\s-\s)(\d{1,2})(\d{2})(?:\s-)(.*)\.(\w{3})$"
Get-ChildItem -filter *.avi | Where-Object { $_.Name -match $regex } | Rename-Item -NewName { $_.Name -Replace $regex, "`$1.S0`$2E`$3.`$4.`$5" }
I have a similar problem;
Rename: 'Artist Name - Show Name.mp3' to 'Artist Name @Artisttwitter - Show Name.mp3'
Can anyone help please?