Jump to content

Recommended Posts

Posted

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

Posted
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

 

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

Posted (edited)

Well, it's not elegant, but it should work....

 

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"

 

You could probably get it down to a one-liner if you did a FOR /F tokens..... in (dir /b Voyager*) rename etc.

Edited by jinnantonnixx
  • Thanks 1
Posted (edited)
Still like to know if there's a proper geeks way of doing it in XP cmd line though

Do you reckon this PowerShell script is geeky enough? :D

 

$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" }

 

Edit. Need to figure out a way to do something similar to what Jinnantonnixx did with the series and/or episode numbers.

Edited by Arthur
  • Thanks 1
  • 1 year later...
Posted

I have a similar problem;

 

Rename: 'Artist Name - Show Name.mp3' to 'Artist Name @Artisttwitter - Show Name.mp3'

 

Can anyone help please?

Posted (edited)
Rename: 'Artist Name - Show Name.mp3' to 'Artist Name @ArtistTwitter - Show Name.mp3'

If @ArtistTwitter is stored as an ID3 tag in each MP3, the quickest way to rename the tracks would be using the 'Tag to Filename' feature of MP3Tag.

Edited by Arthur
Posted
If @ArtistTwitter is stored as an ID3 tag in each MP3, the quickest way to rename the tracks would be using the 'Tag to Filename' feature of MP3 Tag].

 

In most cases the artists don't fill in the ID3 tag at all, so my playout system uses the file name..

 

However, what I want to do is automate the process using batch files, so MP3 tag is not an option for me I'm afraid.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...