Move some characters from beginning to relative end

Advanced Renamer forum
#1 : 12/12-24 19:36
Denis Normandin
Posts: 2
The move function (if I understand correctly) allows to specify a number of characters from either the start or the end of a name to another position calculated from the same point.
What if I need to move a number of characters counted from the start point to another position counted from the end?

Ex: Many pictures in the same folder to be renamed from:
- 2024-10-05-Alex-Birthday-Party--pics-by-Dad-001.jpg
- 2024-08-05-Daniel-Birthday-Party--pics-by-Dad-023.jpg
- 2023-12-25-Christmas-Family-Party--pics-by-Dad-018.jpg
To:
- Alex-Birthday-Party-2024-10-05--pics-by-Dad-001.jpg
- Daniel-Birthday-Party-2024-08-05--pics-by-Dad-023.jpg
- Christmas-Family-Party-2023-12-25--pics-by-Dad-018.jpg

If counting from the beginning (or the end) for both the origin and destination, it can't work because there is a part that has a different lenght from file to file. It would work if the origin could be counted from the start and the destination could be counted from the end. Or, in some other situation, the opposite.

I think it would be a nice addition in a future version of Advanced Renamer.
#2 : 12/12-24 20:15
Miguel
Posts: 163
Reply to #1:
Hi Dennis
If all your files follow the pattern of your examples you can use regular expression and a Replace method:

REPLACE: (\d{4}-\d{2}-\d{2})-(\w.+)--(\w.*)
REPLACE WITH: $2-$1--$3
OCCURRENCE: ALL
REGULAR EXPRESSION: YES.
APPLY TO: Name

Test the New Filename column before pressing Start Batch.

If someting goes wrong you can use Undo Batch.

Miguel


#3 : 12/12-24 21:25
Delta Foxtrot
Posts: 364
Reply to #2:

Hi Denis, Miguel,

That's funny, I had forgotten there even WAS a "Move" function. I don't think I've ever used it, in 10+ years using ARen, probably at least in part for the reason you discuss. I haven't done the math, but I suspect it's one of those situations where your solution would be of very limited use, due to other files in the list not matching the pattern and being changed anyway.

The replace method and regular expressions are, in my opinion, a much better option for this kind of thing. I know many people are regex-shy because it looks so "computer-y," but I assure you that an hour learning the basics will allow you to do so much more, not just in ARen but in almost any text-manipulation situation (given appropriate software tools).

Best,
DF
#4 : 12/12-24 22:20
Denis Normandin
Posts: 2
Reply to #2:

Hi Miguel,

Thanks for your answer.
I have already renamed my files doing multiple passes of the basic 'replace' function.

I'm not comfortable with 'expressions'. They look like Chinese to me. :(

Thanks anyway.

I still think that implementing a "count origin from Start/End" toggle and a "count destination from Start/End" should not be so hard to add to the 'Move' function. (Not too hard for the programming team,... still Chinese to me)

;)

Denis N

#5 : 12/12-24 23:11
Delta Foxtrot
Posts: 364
Reply to #4:

<laughing> Understood! I'm not comfortable with skydiving or commercial air travel, so I get it! :)

Best,
DF