A question of multiple file inline rename?

when using inline rename, say on a tv show of 8 epsoides, I want to shorten that name as I might in the advanced rename window..

the lord of the rings the rings of power s01e01 1080p.mp4

to

the rings of power s01e01 1080p.mp4

when I do this in a lister it will rename all 8 files to the same shortened name with

the rings of power s01e01 1080p (1) through (8).mp4 appended to them.

it also seems this happens when using the Ctrl-Key rename. Example here for all Uppercase...

image

is this defualt for multi-inline-rename? did I over look something in Prefs?
did I overlook a related setting some where else that's influencing this?

I notice on Preferences / File Operations / Renaming Files if un-tick Rename all selected files at once this won't happen and it back to rename one file at time.

That’s what the Preferences option does.

IMO, multi-file rename is best done in the Rename dialog, not via inline rename. But some people are used to File Explorer’s (extremely limited) multi-file inline rename support and want the same in Opus, so we have that option for it.

That's what I was about to say : that use case command to use the rename dialog, either with :
wildcard renaming : from the lord of the rings * to *
regular expression (if you want something fancier) : from the lord of the rings .* (s[0-9]*e[0-9]*) .* to The Rings of Power \1
Direct change : By clicking in the NewName column of the dialog, if you want to remove the first (or last) N characters, it's quite easy and fast.

haha, love it. its so simple in the dialogue window to shorten the top file and everything before will match it, but without renaming all the the other details to match (1).

I usually use the rename window, I think ill just stick to that.

but... While I have your attention @PassThePeas , do you have a Regex rename preset tucked away for renaming a sample like this...

the tool a use to grab youtube videos makes these crazy long Folder and File names like this.. I have trouble viewing them for long file names.

Compiling & Decompiling AutoHotkey Script to EXE _ AutoHotkey Tutorials (720p_60fps_H264-128kbit_AAC).mp4

do you have a regex preset that would delete the (720p_60fps_H264-128kbit_AAC) the ((the parentheses and everything inside them)) ?

:slight_smile:

regex makes my head spin. I haven't tried to figure it out yet.

I just ask chat gpt. She came up with this.. \s*\(.*?\) which makes sense when I look at it next to chart, slowly.
gpt was actually useful. Every time she tries to write a script is messed up. No wonder programmers are being fired everywhere and windows always breaks with updates. LOLOLOL

:slight_smile:
Basics of regexp are not that hard, but everytime you need them you encounter some kind of specific use case which gets tricky !
In general, when it gets tricky, I head to an online regexp tester or search online a solution for my specific need.

Anyway, for your use case, I think something like this should work if your expression between parentheses is at the end of the string :

  • Go for regexp + search and replace (ignore extension ticked)
  • Existing Name : \((?:.(?!\())+\)$
  • New Name : (leave it blank) :

As you'll be able to see in details in regexr (RegExr: Learn, Build, & Test RegEx) :

  • : a space character
  • \( : matches an opening parenthese
  • (?:.(?!\()) : is a non capturing group that ensures there are no other opening parenthese after (it is called a negative lookahead)
  • + : to allow for any number of such characters not being a (
  • \) : a closing parenthese
  • $ : end of string

Since I was at it, I created the function that does that (with the button at the bottom of the rename dialog) :

Rename FINDREP REGEXP PATTERN=" \((?:.(?!\())+\)$" IGNOREEXT
1 Like

Good.
It will just eat everything starting from the first ( ... so you'd better not have any other than the one at the end in your filename.

thanks!

good thinking of (a double) (set)

https://regex101.com is good tool too.

Yes, there are many.