Renamer - prepend text

Started by EdP, August 20, 2024, 03:52:38 PM

Previous topic - Next topic

EdP

I am sure I'm missing something but I need to append text at the beginning of (part of) an existing filename and cannot see how to do it. Basically I am trying to extract useful text from an existing filename and add my naming (which includes a sequence number) in front of it.

Here's an example original filename:

unneeded-text_photo-description.jpg

Desired final result: ABC001_photo-description.jpg

I can extract the text I need (everything after the underscore) using Remove text and a regex of .+_ (i.e. delete everything up to the single underscore) but can't see how to then add the text I want (ABC) and a counter (001) before the extracted text.

Mario

#1
This is not so easy, because you would need a step currently not implemented in the Renamer: PrependText.
A text step that puts text/variables in front of the current result. The Text step currently always appends to the current result. And we would also need a "prepend" version for the sequence number etc. Basically many steps twice, in order to handle your specific requirement.

I would try it this way:


Image1.jpg

First add the ABC prefix and global sequence number ABC001 and then remove the unwanted text.
Which gives, in my test case:

ABC001_photo-description.jpg

If the text you want to remove contains ABC or numbers, things may get more complicated.
You may need to add a special character after the sequence number and then maybe us ReplaceBefore...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook