+ Post New Thread
Results 1 to 9 of 9
How do you do....it? Thread, rename files using wildcards in Technical; I've got a series of files called Voyager - 3xx -EpisodeName.avi that need renaming to Voyager.S03Exx.EpisodeName.avi to make my DLNA ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,822
    Thank Post
    1,476
    Thanked 593 Times in 445 Posts
    Rep Power
    168

    rename files using wildcards

    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

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    If this is just a one-off, I would probably use Renamer.


  3. Thanks to Arthur from:

    SimpleSi (14th April 2011)

  4. #3

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,698
    Thank Post
    335
    Thanked 516 Times in 484 Posts
    Rep Power
    180
    Quote Originally Posted by SimpleSi View Post
    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 )

    Steve

  5. #4

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,822
    Thank Post
    1,476
    Thanked 593 Times in 445 Posts
    Rep Power
    168
    @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

  6. #5

    jinnantonnixx's Avatar
    Join Date
    Mar 2011
    Location
    In the Calamatorium.
    Posts
    1,995
    Thank Post
    115
    Thanked 507 Times in 342 Posts
    Blog Entries
    2
    Rep Power
    286
    Well, it's not elegant, but it should work....

    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"
    You could probably get it down to a one-liner if you did a FOR /F tokens..... in (dir /b Voyager*) rename etc.
    Last edited by jinnantonnixx; 14th April 2011 at 09:53 AM.

  7. Thanks to jinnantonnixx from:

    SimpleSi (14th April 2011)

  8. #6


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    Quote Originally Posted by SimpleSi View Post
    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?

    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" }
    Edit. Need to figure out a way to do something similar to what Jinnantonnixx did with the series and/or episode numbers.
    Last edited by Arthur; 15th April 2011 at 08:58 AM.

  9. Thanks to Arthur from:

    SimpleSi (15th April 2011)

  10. #7
    1Mix's Avatar
    Join Date
    Jun 2012
    Location
    Isle of Man
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    rename files using wildcards

    I have a similar problem;

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

    Can anyone help please?

  11. #8


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    Quote Originally Posted by 1Mix View Post
    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.
    Last edited by Arthur; 12th June 2012 at 07:21 AM.

  12. #9
    1Mix's Avatar
    Join Date
    Jun 2012
    Location
    Isle of Man
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by Arthur View Post
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 1
    Last Post: 13th October 2010, 10:46 AM
  2. Rename a batch of files all at once.
    By Kyle in forum How do you do....it?
    Replies: 10
    Last Post: 19th November 2009, 06:31 AM
  3. Smoothwall wildcards - MySpace signups
    By theeldergeek in forum Internet Related/Filtering/Firewall
    Replies: 1
    Last Post: 7th October 2009, 12:50 PM
  4. Can't rename files/folder
    By adamf in forum Windows
    Replies: 5
    Last Post: 30th January 2009, 11:32 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •