Hi, sorry this is probably really basic but I'm trying to learn.
I have a group of files named with the pattern * - [*] * where the asterisks are different words and other characters. I am trying to delete everything but the last string, which is essentially everything after the ] and before the file extension. I thought the simplest solution would be
Old: ( . * ) ] ( . * )
New: \2
Ignoring extension
But this does nothing. I thought that (.*) means a string of any length of any characters and \2 refers to the second string. Can you explain what I am missing and what the easiest solution would be?
Also is there an easy way to affix a random unique number with a specific amount of padding to the front of a file as a match rename process?
After some trial and error, it seems like any brackets or parentheses in the original filename will break the regular expressions. Is there a quick fix for this?
I had to add spaces in my example in order to avoid italics.
Ok adding a \ before the bracket worked, thanks. I still don't fully understand the why lol.
I'm USA.
Obviously, I'm not from this world.
But, I've been reading, learning and posting here for some time.
I think it has done me some good.
Locals just don't get it !
My homemade pizza is almost done.
I'll have to think on that question, but I know I have a rename preset script that does random characters FWIW.
The more concise way would be by using evaluator I think, but I've never tested it in such context.
Otherwise a rename script can do that but will require a litlle more coding.
Yes.
Renames can use column keywords, but I have been unable to use Evaluator Column Keywords.
Do you happen remember my homemade Random Number Evaluator Column that I posted when you requested the Rnd() Evaluator function ? Evaluator Function: Random Number Generator
My column, admittedly a bit crude, does result in different random numbers for all files/folders in the column.
If we could access Evaluator Column keywords in rename, it may be possible to do this using Evaluator. The trouble in this example is my use of Global Variables. That admittedly could be a problem.
(I would still prefer an Evaluator random function that generates a new number every time it is called. So far, I haven’t encountered a scenario where the current behavior has been useful.)
I think it does that already. The problem is it’s only being called once to generate the command line. The rename command doesn’t see the evaluator code because it has already been turned into a string during argument parsing.
Escaping the {=…=} code is needed, so it is parsed by the Rename command instead of being parsed before the command runs. I think that’s done by doubling the first { but I am not currently at a PC to verify that.