• Any software to partially change case of file/folder name?

    Home » Forums » AskWoody support » Questions: Browsers and desktop software » Other desktop and Microsoft Store software » Any software to partially change case of file/folder name?

    Author
    Topic
    #501198

    When naming music files I like to have them formatted like this…

    “ARTIST – Title”

    Is there a way to change “Artist – Title” to “ARTIST – Title” without having to retype filename?

    Viewing 13 reply threads
    Author
    Replies
    • #1518351

      Have you managed to change the name manually? I ask because Windows ignores case in filenames etc. I tried changing the case of a file without success and had to do it in two changes (I added a number to the bit I wanted to change and then was able to change it back to the name and case I wanted).

      I suspect this would have to be done with a batch file or Powershell script, there are quite a few who are experts in these on here.

      Eliminate spare time: start programming PowerShell

      • #1518502

        Have you managed to change the name manually? I ask because Windows ignores case in filenames etc. I tried changing the case of a file without success and had to do it in two changes (I added a number to the bit I wanted to change and then was able to change it back to the name and case I wanted).

        I suspect this would have to be done with a batch file or Powershell script, there are quite a few who are experts in these on here.

        Never had any problem changing the case, yes, Windows does see it as the same filename (can even change it whilst the file is open) but always displays it the way I wrote it (unlike some 3rd party softwares which will change the case if saved through them).

        Can you supply some sample file names and we will have a go at it.

        cheers, Paul

        Here’s a sample list of folders I’ve changed from…

        Awolnation – Run (2015)
        Faith No More – Sol Invictus (2015)
        Joe Satriani – Crystal Planet (1998)
        Looper – Offgrid Offline (2015)
        Man Or Astroman – Inside The Head Of John Peel (1997)
        Peatbog Faeries – Blackhouse (2015)
        Roisin Murphy – Hairless Toys (2015)
        Steve Vai – The Ultra Zone (1999)

        To…

        AWOLNATION – Run (2015)
        FAITH NO MORE – Sol Invictus (2015)
        JOE SATRIANI – Crystal Planet (1998)
        LOOPER – Offgrid Offline (2015)
        MAN OR ASTROMAN – Inside The Head Of John Peel (1997)
        PEATBOG FAERIES – Blackhouse (2015)
        ROISIN MURPHY – Hairless Toys (2015)
        STEVE VAI – The Ultra Zone (1999)

        The best method I’ve found so far (especially with a lot of folders) is to generate a list of the folders (I use XYplorer for this), paste the list into a Word document, highlight all the bits I want in capitals & use Words case changing function (basically what I would ideally like in the right click menu of Explorer) & then copy & pasting each folder name one at a time from Word back into the folder name.

        Longwinded process I know but a quicker than doing them all manually (especially for a one fingered typest like myself).

        Of all the renaming software I’ve tried so far they will only apply case changes to the whole file/folder name, not partially as I require.

        Thank you for any insight you may give.

    • #1518416

      Can you supply some sample file names and we will have a go at it.

      cheers, Paul

    • #1518556

      Alrock,

      Here’s a little PowerShell script that will work on the directories one level under the directory your specify as a parameter.
      PS: RenameDirsbyPattern.ps1

      Code:
      Param (
             [Parameter(Mandatory=$true)]
             [string] $SourceDrivePath 
            )
      
      #Clear-Host
      
      If (Test-Path "$SourceDrivePath") {
        ForEach ($Dir in Get-ChildItem -Directory "$SourceDrivePath" `
                  -Attributes "D") {
          If ($Dir.BaseName.indexof('-') -ge 0) {
            $x = $Dir.BaseName.IndexOf('-')
            $temp = $Dir.BaseName.substring(0,$x-1)
            $NewBaseName = "$($temp.ToUpper()) $($Dir.BaseName.substring($x))"
            Rename-Item -Path "$SourceDrivePath$Dir"`
                        -NewName "-$NewBaseName" -Force
            Rename-Item -Path "$SourceDrivePath-$NewBaseName" `
                        -NewName "$NewBaseName" -Force
      
          } #End If($Dir.BaseName...)
      
        }   #End ForEach ($Dir...)
      }     #End If (Test-Path...)
      Else {
            Write-Host "$SourceDrivePath is not a Valid Drive:path spec!"
            $ans = Read-Host "Press Enter to continue"
      }    #End Else
      

      To run open a PowerShell cmd window and type:
      d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test” {replacing G:Test w/your drive directory.}

      Starting Data:
      41519-RenameStartingPOS
      Ending Data:
      41520-RenameEndingPOS
      You’ll notice the two Rename-Item commands in the code. This is because PS doesn’t recognize that the folder name has been changed if you only change the case! So what I did was add a – to the front of the name in the first rename then remove it with the second rename.

      If you have never run PowerShell see Post #2 Items 1-3 Here.

      BTW: You’ll notice that the program did not change Test TSM as it does not have a – in the name!.

      As always when testing software on your data test on a copy first! This software has NO WARRANTY!

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1518685

      Alrock,

      Here’s a revised version of the Powershell that will recurse through the entire directory structure starting with the directory you specify. I tried to do this last evening but was a bit too groggy to figure it out.

      Code:
      Param (
             [Parameter(Mandatory=$True)]
             [string] $SourceDrivePath
            )
      
      #Clear-Host
      
      If (Test-Path "$SourceDrivePath") {
        ForEach ($Dir in Get-ChildItem -Directory "$SourceDrivePath" `
                  -Attributes "D" -Recurse) {
          If ($Dir.BaseName.indexof('-') -ge 0) {
            $x = $Dir.BaseName.IndexOf('-')
            $temp = $Dir.BaseName.substring(0,$x-1)
            $NewBaseName = "$($temp.ToUpper()) $($Dir.BaseName.substring($x))"
      
      
            Rename-Item -Path "$($Dir.Fullname)" `
                        -NewName "$NewBaseName-" -Force
      
            Rename-Item -Path "$($Dir.Fullname)-" `
                        -NewName "$NewBaseName" -Force
      
      
          } #End If($Dir.BaseName...)
      
        }   #End ForEach ($Dir...)
      }     #End If (Test-Path...)
      Else {
            Write-Host "$SourceDrivePath is not a Valid Drive:path spec!"
            $ans = Read-Host "Press Enter to continue"
      }    #End Else
      

      You’ll notice, or not, that I’ve moved the added hyphen from the front of the directory name to the end of the directory name. This was necessary because as the code navigates the directories I had to be able easily append, rather than stick in the middle, the – on the second Rename-Item command. I also had to capture the Dir.Fullname each time through the loop because I could no longer depend on it being the SourceDrivePath value as the code moves through the sub-directories.

      The above may or may not make sense to you but I thought I’d provide an explanation for those who may be interested.

      41522-MusicRecurseTL
      41523-MusicRecurseSL

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1518701

      I knew you’d come up with the goods RG!

      Eliminate spare time: start programming PowerShell

    • #1518733

      Thanks, I’ll try it later & let you know how it went.

    • #1518779

      That’s a slick little piece of code there RG. I’ve been trying to learn PS and this is helpful.

      • #1518848

        That’s a slick little piece of code there RG. I’ve been trying to learn PS and this is helpful.

        B.

        Thank you…Thank you very much!

        We’re in the same boat as I learning it also. Just keep on plug’n, google’n, experment’n, and of course Lounge’n as we say in the South! :cheers:

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

    • #1519210

      Tried it but something went wrong somewhere…

      Copy & pasted your 1st code into notepad & renamed file to RenameDirsbyPath.ps1 as per your instructions…

      1st attempt got an error about execution of scripts being disabled, so Googled that & then tried again…

      2nd attempt…

      Code:
      Windows PowerShell
      Copyright (C) 2009 Microsoft Corporation. All rights reserved.
      
      PS C:Windowssystem32> set-executionpolicy remotesigned
      
      Execution Policy Change
      The execution policy helps protect you from scripts that you do not trust.
      Changing the execution policy might expose you to the security risks described
      in the about_Execution_Policies help topic. Do you want to change the execution
       policy?
      [Y] Yes  [N] No  [S] Suspend  [?] Help (default is “Y”): y
      PS C:Windowssystem32> I:RenameDirsbyPattern.ps1 -SourceDirPath “H:MP3”
      I:RenameDirsbyPattern.ps1 : A parameter cannot be found that matches parameter
       name ‘SourceDirPath’.
      At line:1 char:42
      + I:RenameDirsbyPattern.ps1 -SourceDirPath <<<<  "H:MP3"
          + CategoryInfo          : InvalidArgument: (:) [RenameDirsbyPattern.ps1],
         ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,RenameDirsbyPattern.ps1

      Will try & figure out where I went wrong but since it is pretty much double dutch to me, any pointers would be handy.

    • #1519226

      If you are interested in an alternative approach and, you are familiar with Bulk Rename Utility. (BRU), you might try BRU.

      Here is an example;
      From: Applause – Lady Gaga (with Vocals).cdg
      From: Applause – Lady Gaga (with Vocals).mp3

      To: Lady Gaga (with Vocals).- Applause.cdg
      To: Lady Gaga (with Vocals).- Applause.mp3

      This is what you have to do in BRU.
      1. Set RegEx (1) as:
      MATCH: (.*?)-(.*)
      REPLACE: 2 – 1

      2. In the Remove (5) field, check “Trim” (that’ll remove any spaces left at the beginning of the file name).

      3. Use the preview to see if everything’s OK, and then press “Rename”.

      See attachment for result.
      Once you get the hang of it, you have lots of power.
      Best wishes,
      Michael
      41555-Reverse-Artist-Title-Names-with-BRU

    • #1519232

      Alrock,

      My bad! I typoed in the instructions!

      This: d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test”
      Should have been this: d:pathRenameDirsbyPattern.ps1 -SourceDrivePath “G:Test”
      Sorry! HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1519507

        Alrock,

        My bad! I typoed in the instructions!

        This: d:pathRenameDirsbyPattern.ps1 -SourceDirPath “G:Test”
        Should have been this: d:pathRenameDirsbyPattern.ps1 -SourceDrivePath “G:Test”
        Sorry! HTH :cheers:

        Still not working for me… However, refusing to be beat I returned to my usual Renaming software fueled with a renewed determination to figure out just how to do it… Finally solved the puzzle, steps below for anybody interested…








    • #1519508



      Thanks for all the help & inspiration…

    • #1519961

      Nothing can be better than a dedicated script, but I find this to be a good, general-purpose renamer. It shows you what your filenames will look like BEFORE you commit the rename process, which is wonderful. There’s also an Expert mode:

      http://www.1-4a.com/rename

    • #1520673

      http://www.bulkrenameutility.co.uk has a powerful, free utility for renaming groups of files (bulkrenameutility.exe).

    • #1523910

      ZtreeWin is like the old DOS Xtree in its user interface. It is a great disk and file management tool that enables touch typists to be highly productive.

      To change a file name, I point at the file, press r (for rename), then type a new name, or to just change the case, press the tab key repeatedly to cycle through proper case (first character capitalized), lower case and upper case.

      See http://www.ztree.com/html/ztreewin.htm
      It is modestly priced shareware. If you have a bunch of files to rename, you could use it just for that, then if it is not not useful for other things to you, just quit using.

      Here is from the home page, in case you don’t want to click the above link:

      [TABLE]
      [TR]
      [TD][/TD]
      [TD=”width: 557″] [TABLE]
      [TR]
      [TD=”width: 557″] ZTreeWin is a fast and flexible text-mode file/directory manager for all versions of Windows. It has been developed as the successor to the legendary DOS file-manager XTreeGold. Anyone who has used that remarkable program would be aware of its superior capabilities as a text-mode, tree-structured file-manager – but would also likely be aware that its limited memory support, and lack of long filename support are today a major issue.
      ZTreeWin is a native Windows program (both 32-bit and 64-bit) that has been developed to provide all the powerful functionality of the past (and much more!), while avoiding all the limitations of the old DOS-based program. A few advantages of ZTreeWin:

      [/TD]
      [/TR]
      [TR]
      [TD]

        [*=left]Log millions of files, limited only by free memory
        [*=left]Long file and directory names fully supported
        [*=left]Integration with most popular third-party archivers right out of the box

      [/TD]
      [/TR]
      [TR]
      [TD] ZTreeWin is available in two versions: v2 for Windows NT, 2000, XP, Vista, 7,8 & 10 (both 32-bit and 64-bit), and v1 for Windows 95, 98 & ME.
      Read some of our customer testimonials.
      [/TD]
      [/TR]
      [/TABLE]
      [/TD]
      [/TR]
      [/TABLE]
      [TABLE]
      [TR]
      [TD=”width: 50″][/TD]
      [TD][/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [TD=”width: 464″] [TABLE]
      [TR]
      [TD=”width: 36″] [TABLE=”width: 100%”]
      [TR]
      [TD=”align: center”][/TD]
      [/TR]
      [/TABLE]
      [/TD]
      [TD=”width: 419″] Now available for download: v2.2
      [/TD]
      [TD=”width: 9″] [/FONT]
      [/TD]
      [/TR]
      [/TABLE]
      [/TD]
      [/TR]
      [/TABLE]
      [TABLE=”width: 598″]
      [TR]
      [TD=”width: 25″][/TD]
      [TD=”width: 157″][/TD]
      [TD=”width: 416″][/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [TD=”class: TextObject, width: 573, colspan: 2″] Here is just a sample of the enhancements in v2.x:

        [*=left]Completely rewritten as a fully Unicode-enabled application
        [*=left]Additional archiver support – FreeArc & UHARC
        [*=left]Enhanced color configuration
        [*=left]Error logging and summary dialog
        [*=left]Extended statistics report of system and logon information
        [*=left]History lists support unlimited marked entries
        [*=left]Log directories using wildcards (Treespec & Ctrl-ZLog)
        [*=left]One way and two way branch synchronization (Alt-Mirror / F8 Sync)
        [*=left]Pruning support for partially logged branches
        (See the complete release notes here or view the included file HISTORY.TXT)

      [/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [TD]


      [/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [/TR]
      [/TABLE]
      [TABLE]
      [TR]
      [TD=”width: 32″][/TD]
      [TD][/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [TD=”width: 628″] [TABLE]
      [TR]
      [TD=”colspan: 2″]

      Despite its DOS-like appearance, ZTreeWin is a native Windows application that works easily and efficiently with modern 32-bit and 64-bit operating systems, and in fact, does not run in DOS!

      [/TD]
      [/TR]
      [TR]
      [TD=”width: 333″]

      [/TD]
      [TD=”width: 284″] The now-standard “tree-structured” hierarchy of directories, invented by XTree, is displayed in the top left corner, the files contained in the highlighted directory listed below left, disk and file statistics on the right side, and keyboard-command menus at the bottom.
      And ZTreeWin retains the fast keyboard-command text-mode response that XTree pioneered and file management professionals still demand.

      ZTreeWin also adds many other sophisticated tools, such as case-specific renaming functions, copy & paste facilities, and file type coloring, that are not only possible but essential to modern 32-bit and 64-bit systems.
      [/TD]
      [/TR]
      [/TABLE]
      [/TD]
      [/TR]
      [/TABLE]
      [TABLE]
      [TR]
      [TD=”width: 31″][/TD]
      [TD][/TD]
      [/TR]
      [TR]
      [TD][/TD]
      [TD=”width: 639″] [TABLE]
      [TR]
      [TD=”width: 262″]
      [/TD]
      [TD=”width: 364″] ZTreeWin is a true 32-bit/64-bit application that makes use of that environment to bring best-in-class, high performance keyboard-command text-mode file management to the demanding professional level.
      It’s all about productivity! ZTreeWin provides fast, mnemonic access to all commonly needed file-management tasks, as well as unlimited command history, and macro recording and playback. Any task you do with ZTreeWin can be made extremely easy to do again in the future.
      ZTreeWin is becoming the most productive, vibrant, and growing disk and file management utility by addressing the needs of today’s professionals with a very responsive dialog and development effort while building on well established and time-proven methods and procedures.
      [/TD]
      [/TR]
      [/TABLE]
      [/TD]
      [/TR]
      [/TABLE]

      When naming music files I like to have them formatted like this…

      “ARTIST – Title”

      Is there a way to change “Artist – Title” to “ARTIST – Title” without having to retype filename?

    Viewing 13 reply threads
    Reply To: Any software to partially change case of file/folder name?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: