SimpleSi Posted April 13, 2011 Posted April 13, 2011 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
Arthur Posted April 13, 2011 Posted April 13, 2011 If this is just a one-off, I would probably use Renamer. http://i.min.us/imM5jG.png 1
Steve21 Posted April 14, 2011 Posted April 14, 2011 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 (or shout if you're using Renamer and I wont knock one ) Steve
SimpleSi Posted April 14, 2011 Author Posted April 14, 2011 @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
jinnantonnixx Posted April 14, 2011 Posted April 14, 2011 (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 April 14, 2011 by jinnantonnixx 1
Arthur Posted April 15, 2011 Posted April 15, 2011 (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? $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 April 15, 2011 by Arthur 1
1Mix Posted June 11, 2012 Posted June 11, 2012 I have a similar problem; Rename: 'Artist Name - Show Name.mp3' to 'Artist Name @Artisttwitter - Show Name.mp3' Can anyone help please?
Arthur Posted June 12, 2012 Posted June 12, 2012 (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 June 12, 2012 by Arthur
1Mix Posted June 12, 2012 Posted June 12, 2012 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now