Multi rename - Rename from text file contents

Suggestions and feature requests.
Post Reply
Message
Author
stephen147
Posts: 330
Joined: 18.10.2015, 16:44

Multi rename - Rename from text file contents

#1 Post by stephen147 » 11.09.2021, 00:51

It would be useful to have the ability to rename from the contents of a text file. So that if I select 50 files and have a text file with 50 names then the multi rename dialog could use that file to rename the files based on that.

As you can see from the example, I've selected the files with the .max extension. I was after a way to rename the .jpg file the exact same name so I thought that this suggestion could be useful for cases like this.

If the file contents doesn't match the file count then there could be a warning message to inform the user that there's a different number of lines in the text file.

I can do it with this PowerShell code but having something like this built into the MR would be great.

Code: Select all

#Mod of this code: https://stackoverflow.com/a/20061560/8262102

$names = Get-Content -LiteralPath "C:\Users\username\Desktop\rename-list.txt"
$files = "Z:\Folder path of files\"
$filesExt = "jpg"

# What if
Get-ChildItem "$files\*.$filesExt" | Foreach {$i=0} {Rename-Item $_ ($names[$i++] + $_.extension) -WhatIf}

# Do the rename - NOTE: Unblock this once your happy with the above.
# Get-ChildItem "$files\*.$filesExt" | Foreach {$i=0} {Rename-Item $_ ($names[$i++] + $_.extension)}
Attachments
example.png
Sceenshots made easy with ShareX.

Forez
Posts: 574
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Multi rename - Rename from text file contents

#2 Post by Forez » 18.09.2021, 15:51

I see a potential in this



I myself do something similar in a more workaround way than your PS1 script:

1] Create alphabetical list of files with various audio extensions [thus create a crude playlist not in form of a file dedicated for such purposes like e.g M3U8]

2] Insert careffuly among them extensionless files in various places

3] Move those extensionless files to a temporary folder

4] Apply to those extensionless files some audio extension like MP3 - with the usage of Multi Rename feature of FC

5] Load up those "MP3" files to Mp3tag

6] Copy in Mp3tag FILENAMEs of those "MP3" files to their TITLEs

7] Copy tag fields data of those "MP3" files - thus in a matter of fact copy their FILENAMEs

8] Load up a whole bunch of pre-prepared copies of one M4A file to Mp3tag

9] Paste in the tag data upon those M4A files

10] Copy TITLEs to FILENAMEs of those M4A files

11] Load up one original untouched M4A file to Mp3tag

12] Copy its tag fields

13] Load up that whole bunch of M4A files

14] Paste in on those M4A files the tag data of that one original M4A file

15] Delete "MP3" files

16] Move M4A files to the folder with the "playlist"

And now I finally have a proper replacement for files from the point #2 of this whole shebang. [Those new files serve the purpose of peculiar audio markers when I listen to such playlist]


So I hope [assuming you have not dozed off] that you can see how an option like this could potentially make my repeatable task of creating such crude playlist much easier / quicker

stephen147
Posts: 330
Joined: 18.10.2015, 16:44

Re: Multi rename - Rename from text file contents

#3 Post by stephen147 » 18.09.2021, 16:14

Only 16 steps! I dozed off at 10 but regained consciousness after a while to finish it lol.. Only joking.

Would the .ps1 file not work to do want to want with a little modification (if needed) until such time that this may get implemented?
Sceenshots made easy with ShareX.

Forez
Posts: 574
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Multi rename - Rename from text file contents

#4 Post by Forez » 25.09.2021, 15:25

You mean you script - I could [rework it and] use it?

That is what I thought. I would have to dig into it though

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests